详细解决Vue的警告:Property or method “xxx“ is not defined on the instance but referenced during render

Bertha 。 2024-02-20 04:10 143阅读 0赞

文章目录

    1. 复现错误
    1. 分析错误
    1. 解决问题

1. 复现错误

今天模拟下单的操作,运行使用Vue刚写好的代码,如下图所示:

在这里插入图片描述

从页面并没有看出任务错误,当我们使用F12打开控制台,却报出如下错误:

在这里插入图片描述

Property or method "name" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property

2. 分析错误

控制台虽然显示红色的异常,但Vue其实报出的并非错误,而是警告:Vue Warn

Vue为什么会报出这样的警告&

发表评论

表情:
评论列表 (有 0 条评论,143人围观)

还没有评论,来说两句吧...

相关阅读