2
0
mirror of https://github.com/tenrok/vue-tribute.git synced 2026-05-17 05:39:39 +03:00
syropian 4afeca31fe 0.1.3
2016-07-26 18:23:18 -04:00
2016-07-26 13:38:34 -04:00
2016-07-24 11:08:04 -04:00
2016-07-17 10:56:41 -04:00
2016-07-17 10:48:56 -04:00
2016-07-24 13:14:47 -04:00
2016-07-26 13:38:34 -04:00
2016-07-16 20:19:04 -04:00
2016-07-26 18:23:18 -04:00
2016-07-26 16:16:54 -04:00
2016-07-26 13:38:34 -04:00

vue-tribute

Build Status

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 options parameter 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.

Events

Tribute broadcasts two events — a tribute-replaced event, and a tribute-no-match event (see docs here). For your convenience, whenever Tribute triggers these events, vue-tribute also emits these events from the Vue instance the bound element is attached to.

License

MIT © Collin Henderson

S
Description
No description provided
Readme MIT 1.5 MiB
Languages
Vue 62.5%
JavaScript 37.5%