一、参考链接
参考链接1:https://segmentfault.com/a/1190000021154285
参考链接2:添加链接描述
二、实现组件
1、组件目录
2、全局单个组件注册
test/testB/index.js
import testB from './main/testB'
testB.install = function (Vue, options) {
Vue.component(testB.name, testB)
}
export default testB
3、全局注册
test/index.js
import testA from './testA'
import testB from './testB'
var components = [
testA,
testB
]
var install = function (Vue, options) {
components.forEach(component => {
Vue.component(component.name, component)
})
}
export default {
install,
testA,
testB
}
4、在package.json中配置打包脚本以及引用入口
打包脚本配置参考:https://cli.vuejs.org/zh/guide/build-targets.html#%E5%BA%93
5、使用
//引入
script src="./lib/index.umd.min.js"></script
//注册
Vue.use(avueData.default);
//使用
<testA></testA>
三、avue-data大屏项目集成到saber 项目中
一把辛酸泪