赞
踩
const requireComponent = require.context('./',true,/\.vue$/);
const install = (Vue)=>{
//插件是否注册
if(install.installed)return;
install.installed;
requireComponent.keys().forEach(element => {
const config = requireComponent(element);
const requireComponentName = config.default.name;
Vue.component(requireComponentName,config.default || config)
});
}
//运作vue生态的插件
if (typeof window !== 'undefined' && window.Vue ) {
install(window.Vue)
}
export default{
install
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。