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


VueDevtools 5.1.1

2014年3月 VueDevtools 的版本是6.61,vue2中的使用 Vuex3.4.0 需要VueDevtools5的老版本

1.  git clone -b v5.1.1 https://github.com/vuejs/devtools.git   克隆git到本地

2.  devtools\shells\chrome\manifest.json   修改 manifest.json 文件中的 persistent 属性为 true

3. npm i 安装依赖包

4. npm run build

5. 添加扩展程序

   点击Chrome浏览器右上角的三个点 -> 更多工具 -> 扩展程序 -> 加载已解压的扩展程序 -> 选定chrome文件夹(注意,安装的文件要放在固定的位置,如果移动了文件夹插件就没有了 

转自 https://blog.csdn.net/weixin_42925169/article/details/119216910


[Vue warn]: Missing required prop: "to"

router-link 里面没有写 to 或者是写错了

https://www.jianshu.com/p/c96e1dc1dafb?utm_campaign=maleskine


[vuex] unknown action type: setting/fetchSetting

折腾半天,问题是仓库的模块里面没开启  namespaced: true  命名空间






Leave a comment 0 Comments.

Leave a Reply

换一张