vue.runtime.esm.js?2b0e:5120 Uncaught TypeError: Cannot read properties of undefined (reading 'install')
at Function.Vue.use (vue.runtime.esm.js?2b0e:5120:1)
at eval (main.js?c31f:10:1)
at Module../examples/main.js (index.js:997:1)
at __webpack_require__ (index.js:849:30)
at fn (index.js:151:20)
at Object.1 (index.js:1067:18)
at __webpack_require__ (index.js:849:30)
at checkDeferredModules (index.js:46:23)
at index.js:925:18
at index.js:928:10
import crmDetail from 'crmdemo-ui'
Vue.use(crmDetail)
这样按需引入,因为给组件加install的时候是默认导出。
在ui项目中的llib/index.js中加上
export const components = { Demo, Card }
之后就能按需引入了
这样按需引入试一下
import Demo from 'mooc-ui/dist/demo.umd'
import Card from 'mooc-ui/dist/card.umd'
Vue.use(Demo)
Vue.use(Card)