GithubHelp home page GithubHelp logo

kabbouchi / v-textcomplete Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jcc/v-textcomplete

0.0 3.0 0.0 218 KB

☀️ A easy-to-use text complete component made with Vue.js.

Home Page: https://textcomplete.pigjian.com/

License: MIT License

JavaScript 43.37% Vue 56.63%

v-textcomplete's Introduction

Powered By Jiajian Chan

A easy-to-use text complete component made with Vue.js.

V - Textcomplete

Here is documents

Installation

npm install v-textcomplete --save

Or

yarn add v-textcomplete --save

Usage

Register component

Registe global component:

import TextComplete from 'v-textcomplete'

Vue.component('text-complete', TextComplete)

Registe component:

import TextComplete from 'v-textcomplete'

export default {
  components: { TextComplete }
}

Simple usage

<template>
  <text-complete v-model="content" areaClass="textcomplete" :strategies="strategies"></text-complete>
</template>

<script>
import { default as githubEmoji } from './github_emoji'
import TextComplete from 'v-textcomplete'

export default {
  components: { TextComplete },
  data() {
    return {
      content: '',
      strategies: [{
        match: /(^|\s):([a-z0-9+\-\_]*)$/,
        search(term, callback) {
          callback(Object.keys(githubEmoji).filter(function (name) {
            return name.startsWith(term);
          }).slice(0, 10))
        },
        template(name) {
          return '<img width="17" src="' + githubEmoji[name] + '"></img> ' + name;
        },
        replace(value) {
          return '$1:' + value + ': '
        },
      }]
    }
  }
}
</script>

Please check the Documentation more

Contributors

Thanks

License

The plugin is open-sourced software licensed under the MIT license.

v-textcomplete's People

Contributors

jcc avatar kabbouchi avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.