Go to comments

记录使用vue中出现的错误

Cannot read properties of undefined (reading 'install')

项目引入vue-router后出现的错误

环境:

VueCLI v5.0.8

vue v2.6.14

time20231208

错误原因:

vue 版本和 vue-router 版本不匹配

直接运行了 npm i vue-router,下载最新版 vue-router 4.2.5,该版本适用于 vue3.0 版本,用在 vue2.0+ 会报错

解决方案: 

npm uninstall vue-router

npm install --save vue-router@3

原文链接:

https://blog.csdn.net/FunSober/article/details/127623124

vue-router3.6.5不报错了


Module not found: Error: Can't resolve 'D:\my-site\src\components\Avater\preview.vue' in 'D:\my-site'

路径错误


Invalid project name 'MySite'

Warning: name can no longer contain capital letters

无效的项目名称,

警告:名称不能再包含大写字母

解决方法:名字全部用小写字母


The "Icon" component has been registered but not used

注册了Icon组件但是没有在模板中使用


This relative module was not found

可能是路径出的问题

https://blog.csdn.net/weixin_44787661/article/details/116224869


[Vue warn]: Unknown custom element: did you register the component correctly?

组件没有注册

https://blog.csdn.net/Guzarish/article/details/118626319


[Vue warn]: Error in created hook

检查钩子函数中的错误

https://www.php.cn/faq/597063.html


Property or method "isLoading" is not defined on the instance but referenced

data配置中没有定义 isLoading 这样的数据

https://blog.csdn.net/qq_44774831/article/details/118372487


[Vue warn]: Error in render: "TypeError: Cannot read properties of null (reading 'rows')"

网络有延迟,所以暂时没有 data.rows 这个数组

自己解决了,方法是加一个 v-if="data" ,也许或者设置一个空数组

参考 https://blog.csdn.net/yanweijie0317/article/details/134069703


[Vue warn]: Error in render: "ReferenceError: data is not defined"

数据 data,代码中应该这样 this.data,没有用this报的错,在模板中多了 this.data 也可能会报错


Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to

this.$router.push({}) 我是对象配置写错了,因为发现地址栏的地址不对

记录两个博客

https://blog.51cto.com/u_15077533/4348965

https://www.cnblogs.com/konglxblog/p/16989780.html


[Vue warn]: Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'categoryId')"

没有读取categoryId属性,计算属性名拼写错了,所以读不到categoryId


[Vue warn]: Invalid prop: type check failed for prop "limit". Expected Number with value 10, got String with value "10".

属性 limit 的类型不是数字类型


[vue-router] Route with name 'DetailBlog' does not exist

内置组件 RouterLisk 的name属性值写跟路由配置的名字不一样

Route with name ' ' does not exist

https://blog.csdn.net/weixin_44448747/article/details/96974752








Leave a comment 0 Comments.

Leave a Reply

换一张