在VueJS中运行测试时出错:未知的自定义元素:< router-link> [英] Error when running tests in VueJS: Unknown custom element: <router-link>

查看:171
本文介绍了在VueJS中运行测试时出错:未知的自定义元素:< router-link>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行我的Karma / Jasmine测试时,在安装包含< router-link> 组件的标头组件后,我在控制台中收到错误日志。这一切都运行完美,但似乎无法修复显示的错误。错误是:

When I run my Karma/Jasmine tests I get a Error Log in the console after mounting my header component which include <router-link> components. It all run's perfectly fine but just can't seem fix the error that displays. The error is:

ERROR LOG: '[Vue warn]: Unknown custom element: <router-link> - did you register the component correctly? For recursive components, make sure to provide the "name" option. (found in <Header>)'

我做了旧的: Vue.use(VueRouter)并且正在运行vue-router:^ 2.4.0,

I have done the old: Vue.use(VueRouter) and am running "vue-router": "^2.4.0",

这篇关于在VueJS中运行测试时出错:未知的自定义元素:&lt; router-link&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆