@whoj/utils-vue
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@whoj/utils-vue

Version Typings License

Install

npm i @whoj/utils-vue # OR pnpm add @whoj/utils-vue

@whoj/utils-vue/fusejs

Fully typed Fuse.js search library.

<template>
  <div>
    <input type="text" v-model="search">
    <p v-if="noResults">Sorry, no results for {{search}}</p>
    <div v-for="(r, i) in results" :key="i">
      {{ r }}
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { useVueFuse } from '@whoj/utils-vue/fusejs';

export default defineComponent({
  setup () {
    const myList = ['aaaa', 'bbbb', 'cccc', 'abc', 'xyz']
    const { search, results, noResults } = useVueFuse(myList)

    return {
      search,
      results,
      noResults,
    }
  }
})
</script>

MIT License © 2022 Jonson B.

Readme

Keywords

Package Sidebar

Install

npm i @whoj/utils-vue

Weekly Downloads

148

Version

2.0.0

License

MIT

Unpacked Size

407 kB

Total Files

89

Last publish

Collaborators

  • who_jonson
  • who_j