【问题标题】:Reuse VueJS components outside solution在解决方案之外重用 VueJS 组件
【发布时间】:2020-12-15 09:45:45
【问题描述】:

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

解决方案 A

components
   component1.vue
   component2.vue

解决方案 B

components
   component3.vue
   component4.vue

我需要重用SolutionB中的SolutionA组件,有没有办法在npm不发布SolutionA的情况下做到这一点?

谢谢!

【问题讨论】:

  • 为什么不本地导入?

标签: vue.js components reusability


【解决方案1】:

找到解决方案:

  • 使用npm link在SolutionB中引用SolutionA;
  • 在SolutionB package.json的devDependecies中添加SolutionA;
  • 然后简单的在component3.vue中导入component1.vue

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-06
    • 1970-01-01
    • 2020-02-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多