vue报错Property or method "attributename" is not defined on the instance but referenced during render

报错:

[Vue warn]: Property or method "attributename" 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.

这个是照着vue的中文文档敲的,运行之后报这个错也是real头疼

这是官方文档:

                        vue报错Property or method

这是我的代码:

                               vue报错Property or method

查了半天没查出来什么原因,初学乍练的以为写在data里面的位置不对,但是也不可能啊,头疼之际灵光一闪,把attributeName改成了attributename,没想到竟然成功了!按这个思路再去百度,百度到一篇短小精悍的cnblog,表明可能是因为attributeName是关键字,所以不能用,不确定是不是真的。反正改完就好了。被官方文档坑了一小下。

你可能感兴趣的:(vue)