随笔分类 -  控制台报错

在书写代码中遇到的一些报错
摘要:Vue控制台报错 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'category1Name') 先说明我这个情况:我用计算属性返回了state里面的数据,并且在页面挂载时发请求获取数据,展 阅读全文
posted @ 2023-02-08 21:03 BjpFee 阅读(380) 评论(0) 推荐(0)
摘要:控制台报错:RangeError: Invalid array length 原因:Vue中的V-for指令,可以遍历数组,对象,字符串以及数字,问题就出在遍历数字上 如果遍历的数字不是一个正整数,那么就会出现这个报错。 解决:把遍历的数字整化:parseInt(asd); 把运算的数整话,具体为向 阅读全文
posted @ 2023-02-07 20:55 BjpFee 阅读(2437) 评论(0) 推荐(0)
摘要:控制台报错:Cannot convert undefined or null to object 原因:使用了对象合并的方法 Object.assign(a,b) ,把b对象合并到a里面去,而这个方法的要求就是,a不能为空 阅读全文
posted @ 2023-02-04 13:20 BjpFee 阅读(2480) 评论(0) 推荐(0)
摘要:控制台报错:Extraneous non-props attributes (k) were passed to component but could not be automatically inherited because component renders fragment or text 阅读全文
posted @ 2023-02-04 13:12 BjpFee 阅读(775) 评论(0) 推荐(0)