Vue的常见问题:console.log报错

本文介绍了解决因eslint校验导致的异常图片显示问题,提供了两种有效解决方案:一是使用window.console.log替代console.log;二是调整package.json中eslintConfig的rules设置,将no-console设为off,从而允许使用console.log。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

异常图片:

主要原因是eslint的曝出的异常没有通过eslint的校验

解决方法:

方法一:使用window.console.log代替console.log

方法二:将eslint不校验console.log   在package.json 页面下的eslintConfig中的rules下设置 :"no-console":"off"

然后重新编译项目就可以了

this.userProdList.push(response.data) 报错Error in render: "TypeError: Cannot read properties of undefined (reading 'pic')" found in ---> <Order> at src/views/user/user/item.vue <AppMain> at src/layout/components/AppMain.vue <Layout> at src/layout/index.vue <App> at src/App.vue <Root> warn @ vue.runtime.esm.js:619 logError @ vue.runtime.esm.js:1884 globalHandleError @ vue.runtime.esm.js:1879 handleError @ vue.runtime.esm.js:1839 Vue._render @ vue.runtime.esm.js:3550 updateComponent @ vue.runtime.esm.js:4066 get @ vue.runtime.esm.js:4479 run @ vue.runtime.esm.js:4554 flushSchedulerQueue @ vue.runtime.esm.js:4310 eval @ vue.runtime.esm.js:1980 flushCallbacks @ vue.runtime.esm.js:1906 Promise.then timerFunc @ vue.runtime.esm.js:1933 nextTick @ vue.runtime.esm.js:1990 queueWatcher @ vue.runtime.esm.js:4402 update @ vue.runtime.esm.js:4544 notify @ vue.runtime.esm.js:730 mutator @ vue.runtime.esm.js:882 eval @ item.vue:730 Promise.then chlidDistributionOpen @ item.vue:728 invokeWithErrorHandling @ vue.runtime.esm.js:1854 invoker @ vue.runtime.esm.js:2179 invokeWithErrorHandling @ vue.runtime.esm.js:1854 Vue.$emit @ vue.runtime.esm.js:3888 handleClick @ element-ui.common.js:9465 invokeWithErrorHandling @ vue.runtime.esm.js:1854 invoker @ vue.runtime.esm.js:2179 original._wrapper @ vue.runtime.esm.js:6917 item.vue:730 TypeError: Cannot read properties of undefined (reading 'pic') at eval (item.vue:1242:1) at Proxy.renderList (vue.runtime.esm.js:2630:1) at Proxy.render (item.vue:1228:1)
最新发布
04-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Zeng__Y1

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值