vue-auto-register

1.2.2 • Public • Published

vue-auto-register

  • 自动注册某一文件夹下的.vue为全局组件

install

$ npm i -S vue-auto-register

start

component

import Vue from 'vue'
import { component } from 'vue-auto-register'
 
// @/componsts/**/Map.vue => <DtMap/>
Vue.use(component)
 
// @/componsts/**/Map.vue => <MyMap/>
Vue.use(component. {
  pre: 'My'
})
 

filter

import Vue from 'vue'
import { filter } from 'vue-auto-register'
import * as filters from '@/path/to/filters'
 
// @fun f1 => {{ msg | f1 }}
Vue.use(filter. {
  filters
})
 
// @fun f1 => {{ msg | f_f1 }}
Vue.use(filter. {
  filters,
  pre: 'f_'
})
 

@/path/to/filters.js

export const ft1 = v => 1
export const ft2 = v => 2

Package Sidebar

Install

npm i vue-auto-register

Weekly Downloads

1

Version

1.2.2

License

ISC

Unpacked Size

4.66 kB

Total Files

6

Last publish

Collaborators

  • niudazhuang