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为什么会报出这样的警告?
我们先将警告Property

订阅专栏 解锁全文
7707




被折叠的 条评论
为什么被折叠?



