v-textcomplete

A simple, flexible and easy-to-use text completion component.
2,633 65
Install
npm install v-textcomplete
Latest Version:0.2.5
Vue:2
License:MIT
Last Updated:Feb 19, 2019
Links: GitHub  ·  npm
Maintainer: jcc

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.

Related Packages

@vesperjs/vue

This is Vesper for Vue.js.

8,552 1
@wzpo/md-ui

Another Momentum UI framework for Vue.js applications

2,054
vuenilla

Unstyled Vue.js component library.

1,552 2
vue-awesome

Font Awesome component for Vue.js, using inline SVG.

510,216 2,422
vue-window-size

Reactivity window size for Vue.js.

219,064 121

Version History

Version Released Vue License
0.2.5 ^2.2.2 MIT
0.2.4 ^2.2.2 MIT
0.2.2 ^2.2.2 MIT
0.2.1 ^2.2.2 MIT
0.2.0 ^2.2.2 MIT