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

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

 

 第二步增加打包组件配置

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

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

 

 第三部打包及打包后文件

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

 

 接下来在另一项目中引用

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

 

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

 

 

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

 

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

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

 

相关文章:

  • 2022-01-03
  • 2021-05-30
  • 2021-12-24
  • 2022-01-20
  • 2022-01-18
  • 2022-12-23
  • 2021-11-10
  • 2021-09-20
猜你喜欢
  • 2022-12-23
  • 2021-10-15
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
相关资源
相似解决方案