JSPM

vue-pluralize

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2685
  • Score
    100M100P100Q116360F
  • License MIT

Handy Pluralize filters for your Vue project

Package Exports

  • vue-pluralize

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-pluralize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vue-pluralize

npm version Build Status Monthly Downloads License: MIT

Handy Pluralize filters for your Vue project.

Installation

Install via NPM...

$ npm install vue-pluralize
// or
$ yarn add vue-pluralize

Import and use like so:

import VuePluralize from 'vue-pluralize'

Vue.use(VuePluralize)

Usage

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.

<span>{{ 'user' | pluralize(10) }}</span>
<!-- renders -->
<span>users</span>

this.$pluralize

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.