1.1.3 • Published 4 years ago

vue-v-tribute v1.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

vue-v-tribute

vue wrapper for tributejs (https://github.com/zurb/tribute)

Setup

npm i vue-v-tribute

Provide default tributejs options for Vue Plugin

You can provide any option supported by tributejs https://github.com/zurb/tribute/blob/master/src/Tribute.js#L8-L33

...
import VueVTribute from 'vue-v-tribute'
...

Vue.use(VueVTribute, {
  noMatchTemplate: () => null,
  lookup: 'name',
  menuItemTemplate: (item: TributeItem<any>) => {
    return `${item.original.name} - ${item.original.username}`;
  },
  selectTemplate: function(item: TributeItem<any>) {
    return '@' + item.original.username;
  },
});

Use as directive

...
    <input
      type="text"
      v-tribute="{values: [ { name: 'Firstname Lastname', username: 'fila' }, { name: 'Max Mustermann', username: 'madmax' }]}"
    >
    </input>
...

Use as directive on wrapper element or wrapper component

...
    <your-custom-input-component
      v-tribute="{values: [ { name: 'Firstname Lastname', username: 'fila' }, { name: 'Max Mustermann', username: 'madmax' }]}"
    >
    </your-custom-input-component>
...
1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.1.24

4 years ago

0.1.23

4 years ago

0.1.22

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.18

4 years ago

0.1.17

4 years ago

0.1.15

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago