Skip to content

doit2024/vue-auto-register

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published