UNPKG

johns-vue-fuse

Version:

A Vue.js pluggin for fuzzy search library, Fuse.js

19 lines (15 loc) 395 B
import Vue from 'vue' import App from './App.vue' import './tailwind.css' import Fuse from 'fuse.js' Vue.config.productionTip = false Vue.prototype.$search = function (term, list, options) { return new Promise(function (resolve, reject) { var run = new Fuse(list, options) var results = run.search(term) resolve(results) }) } new Vue({ render: h => h(App) }).$mount('#app')