1.3.0 • Published 4 years ago

vuefiltersautoimport v1.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Vue Filters Auto Import

Wrapper to define global filters for Vue

NPM Package

Installation

npm i vuefiltersautoimport

Usage

Create your filter class and extends the package main class passing your filter class prototype as first argument to the super constructor. Optionally, as second argument, you can pass an array with methods to ignore:

import VueFiltersAutoImport from 'vuefiltersautoimport'

export default class MyFiltersClass extends VueFiltersAutoImport () {
    constructor () {
        super(MyFiltersClass.prototype, ['auxiliaryMethodThatShouldBeIgnored'])
    }
    
    myCustomFilter (param1, param2) {
        ...
    }

    auxiliaryMethodThatShouldBeIgnored () {}
}

main.js

import Vue from 'vue'
import MyFiltersClass from './filters-or-whereever'

Vue.use(new MyFiltersClass())
1.3.0

4 years ago

1.2.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago