简体   繁体   English

从使用 vue-sfc-rollup 生成的库中导入组件的问题

[英]issues with importing components from a library generated using vue-sfc-rollup

I created a component library using vue-sfc-rollup , however, I met a problem when using a component from it in another project.我使用vue-sfc-rollup创建了一个组件库,但是,在另一个项目中使用它的组件时遇到了问题。 details are in the link below:详细信息在下面的链接中:

to add vue-lib component library I ran添加我运行vue-lib组件库

npm install --save @knowscount/vue-lib

and then placed <InputBox /> & import InputBox from '@knowscount/vue-lib , registering the component, yet the page went blank and the folioing error was reported in the console:然后放置<InputBox /> & import InputBox from '@knowscount/vue-lib ,注册组件,但页面空白,控制台报folioing错误:

[Vue warn]: Error in render: "TypeError: Vue.component is not a function"

found in

---> <App> at src/App.vue
       <Root>
warn @ vue.runtime.esm.js?2b0e:619

and also并且

vue.runtime.esm.js?2b0e:1888 TypeError: Vue.component is not a function
    at eval (vue-lib.esm.js?ca34:5655)
    at Array.forEach (<anonymous>)
    at installVueLib (vue-lib.esm.js?ca34:5654)
    at resolveAsyncComponent (vue.runtime.esm.js?2b0e:3686)
    at createComponent (vue.runtime.esm.js?2b0e:3200)
    at _createElement (vue.runtime.esm.js?2b0e:3422)
    at createElement (vue.runtime.esm.js?2b0e:3353)
    at vm._c (vue.runtime.esm.js?2b0e:3491)
    at Proxy.render (App.vue?6ad7:13)
    at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:3548)
logError @ vue.runtime.esm.js?2b0e:1888

everything is open-sourced here .这里的一切都是开源的。 comment if you would like my configuration stuff posted here.如果您想在此处发布我的配置内容,请发表评论。

I created a component library using vue-sfc-rollup , however, I met a problem when using a component from it in another project.我使用vue-sfc-rollup创建了一个组件库,但是,在另一个项目中使用它的组件时遇到了问题。 details are in the link below:详细信息在下面的链接中:

to add vue-lib component library I ran添加我运行vue-lib组件库

npm install --save @knowscount/vue-lib

and then placed <InputBox /> & import InputBox from '@knowscount/vue-lib , registering the component, yet the page went blank and the folioing error was reported in the console:然后放置<InputBox /> & import InputBox from '@knowscount/vue-lib ,注册组件,但页面空白,控制台报folioing错误:

[Vue warn]: Error in render: "TypeError: Vue.component is not a function"

found in

---> <App> at src/App.vue
       <Root>
warn @ vue.runtime.esm.js?2b0e:619

and also并且

vue.runtime.esm.js?2b0e:1888 TypeError: Vue.component is not a function
    at eval (vue-lib.esm.js?ca34:5655)
    at Array.forEach (<anonymous>)
    at installVueLib (vue-lib.esm.js?ca34:5654)
    at resolveAsyncComponent (vue.runtime.esm.js?2b0e:3686)
    at createComponent (vue.runtime.esm.js?2b0e:3200)
    at _createElement (vue.runtime.esm.js?2b0e:3422)
    at createElement (vue.runtime.esm.js?2b0e:3353)
    at vm._c (vue.runtime.esm.js?2b0e:3491)
    at Proxy.render (App.vue?6ad7:13)
    at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:3548)
logError @ vue.runtime.esm.js?2b0e:1888

everything is open-sourced here .这里的一切都是开源的。 comment if you would like my configuration stuff posted here.如果您想在此处发布我的配置内容,请发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM