在解决方案之外重用VueJS组件

问题描述

我有2个使用VS2019制作的VueJs解决方案:

解决方案A

components
   component1.vue
   component2.vue

解决方案B

components
   component3.vue
   component4.vue

我需要重用SolutionB中的SolutionA组件,有没有办法在npm中不发布SolutionA的方法

谢谢!

解决方法

找到了解决方案:

  • 使用npm link在解决方案B中引用解决方案A;
  • 在SolutionB package.json的devDependecies中添加SolutionA;
  • 然后只需将component1.vue导入component3.vue