Handy Pluralize filters for your Vue project
npm install vue-pluralizeHandy Pluralize filters for your Vue project.
Install via NPM...
``sh`
$ npm install vue-pluralize
// or
$ yarn add vue-pluralize
Import and use like so:
`js
import VuePluralize from 'vue-pluralize'
Vue.use(VuePluralize)
`
Simply set pluralize as the filtering function and you're good to go. At least one argument is expected, which is the number of items.
`html`
{{ 'user' | pluralize(10) }}
users
vue-pluralize attaches the Pluralize instance to your Vue app as this.$pluralize`.
This allows you to call Pluralize from the script portion of your Vue component.
You can add new rules by adding them to the root Pluralize instance.