mirror of
https://github.com/tenrok/vue-tribute.git
synced 2026-06-06 15:22:27 +03:00
1.2 KiB
1.2 KiB
vue-tribute
A Vue.js wrapper for Zurb's Tribute library for native @mentions.
Install
$ npm install vue-tribute --save
or include the UMD build, hosted by npmcdn in a <script> tag. You will also need to include the main Zurb Tribute library:
<script src="js/tribute.js"></script>
<script src="//npmcdn.com/vue-tribute"></script>
Usage
import Vue from "vue";
import VueTribute from "vue-tribute";
Vue.use(VueTribute, options);
The
optionsparameter is optional.
...and inside your template, bind a dynamic values parameter to some data:
<input type='text' :values='items' v-tribute />
The values array should be an array of objects that contain a key and value like so:
[
{key: "Phil Heartman", value: "pheartman"},
{key: "Gordon Ramsey", value: "gramsey"}
]
You can modify this structure using the built-in Tribute options.
License
MIT © Collin Henderson