jest 单元测试vue项目中引入的mintui组件报错

我爱果果2015 2019-02-14 02:45:46
给vue项目用jest写单元测试用例,项目中引入了mintui的相关组件,但是报找不到那些组件

console.error node_modules\vue\dist\vue.runtime.common.js:589
[Vue warn]: Unknown custom element: <router-view> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <Kuandai>
<MtTabContainerItem>
<MtTabContainer>
<Anonymous>
<Root>

console.error node_modules\vue\dist\vue.runtime.common.js:589
[Vue warn]: Unknown custom element: <mt-button> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
...全文
566 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Demonskp 2019-05-28
  • 打赏
  • 举报
回复
在你的测试文件里也要导入mintui,并挂载。 import MintUI from 'mint-ui'; Vue.use(MintUI);

39,083

社区成员

发帖
与我相关
我的任务
社区描述
HTML5是构建Web内容的一种语言描述方式。HTML5是互联网的下一代标准,是构建以及呈现互联网内容的一种语言方式.被认为是互联网的核心技术之一。
社区管理员
  • HTML5社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧