【前端开发】vue子项目打包一个组件供另一个项目使用教程

第一步在子项目中导出组件

 第二步增加打包组件配置

 "build-bundle": "vue-cli-service build --mode production --target lib --name FlowEditorLibrary ./pages/index.js",

 第三部打包及打包后文件

 接下来在另一项目中引用

 

 最后在父项目中随意使用了,注意这里组件名字对于子项目中抛出的组件名

原文地址:https://www.cnblogs.com/xiaohuizhang/p/15308132.html