【发布时间】:2019-01-16 11:16:39
【问题描述】:
我正在使用 vue-cli 通过以下命令构建我的库:
"build": "vue-cli-service build --target lib --name myLib ./src/component.vue",
构建后如何从dist 文件夹导入组件?
我试过了
// undefined
import { component } from '../../myLib/dist/myLib.umd.js'
// undefined
import myComponent'../../myLib/dist/myLib.umd.js'
// see picture below
import * as myComponent'../../myLib/dist/myLib.umd.js'
最后一个变体给了我这个:
我的 component.vue 有效(太大无法显示)
【问题讨论】: