Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
vue2-filters
Advanced tools
The list of standard filters Vue.js 1.* adapted for use in Vue.js 2.*
Simply include vue2-filters
after Vue and it will install itself automatically:
<script src="vue.js"></script>
<script src="vue2-filters.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/vue2-filters/0.1.6/vue2-filters.min.js"></script>
npm install vue2-filters
When used with a module system, you must explicitly install the filters via Vue.use()
:
import Vue from 'vue'
import Vue2Filters from 'vue2-filters'
Vue.use(Vue2Filters)
You don't need to do this when using global script tags.
Example:
{{ msg | capitalize }} // 'abc' => 'Abc'
#### uppercase
+ Example:
```js
{{ msg | uppercase }} // 'abc' => 'ABC'
Example:
{{ msg | lowercase }} // 'ABC' => 'abc'
#### placeholder
+ Example:
```js
{{ msg | placeholder('Text if msg is missing') }} // '' => 'Text if msg is missing'
Arguments:
{String} [symbol] - default: '$'
{Number} [decimal places] - default: 2
Example:
{{ amount | currency }} // 12345 => $12,345.00
Use a different symbol:
```js
{{ amount | currency('£') }} // 12345 => £12,345.00
Use a different number decimal places:
{{ amount | currency('₽', 0) }} // 12345 => ₽12,345
Arguments:
{String} single, [double, triple, ...]
Example:
{{count}} {{count | pluralize('item')}}
// 1 => '1 item' // 2 => '2 items'
```js
{{date}} {{date | pluralize('st','nd','rd','th')}}
// 1 => '1st'
// 2 => '2nd'
// 3 => '3rd'
// 4 => '4th'
// 5 => '5th'
Arguments:
{Array} [items]
{Number} [limit]
{Number} [offset]
Example:
Arguments:
{Array} [items]
{String} [query]
{String} [searchKey]
Example:
Arguments:
{Array} [items]
{String} [sortKey]
{Number} [order] - default: 1
Example:
Sort users by name:
If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.
FAQs
A collection of Vue.js filters
The npm package vue2-filters receives a total of 18,638 weekly downloads. As such, vue2-filters popularity was classified as popular.
We found that vue2-filters demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.