README
Vue Utiities, by Billow
A useful set of utilities designed specifically for Vue apps. Includes the following features:
- Handy set of filters.
- Simple model class for your Vuex stores. Need a full-fledged ORM? Try vue-orm.
- Dot-notation-based mutation helpers for Vuex.
- Passport, a basic local-storage-based OAuth client manager, for general use with a password grant client. Need to authenticate with third-parties? Try vue-authenticate
- Factories: auto-register components (static or lazy) and Vuex stores (supports sync-helpers and nested mutations).
- FormData (as well as a type-safe counterpart that converts non-files to a JSON payload that your backend will need to translate when compiling a request).
- String, Object and Array helpers.
💡 WIP: These docs are a work in progress, and may be moved to a dedicated site at a later stage.
Filters
abbreviateCount
Shorten long numbers into their abbreviated counter-parts.
(input, precision = 1)
2500 | abbreviateCount // 2.5k
25000 | abbreviateCount // 25k
250000 | abbreviateCount // 250k
2510000 | abbreviateCount // 2.5m
2510000 | abbreviateCount(2) // 2.51m
accounting
Format numbers in accounting format, using declarative rules. Uses accounting-big.
(currency = 'R', precision = 2, thousandsSeparator = ',', precisionSeparator = '.', format = '%s %v')
2000 | accounting // R 2,000.00
2000 | accounting('