先说结论,封装一个头部标签detail-header,没有传点击事件里的back方法。好家伙下面的图都不给我加载了,最后把back方法加上恢复正常
报错信息
[Vue warn]: Property or method "back" 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. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
解决过程
1.首先在将封装好的头部引入main.js后,打开网页测试发现下面的图片不加载了,并且报下图错误。
2.去掉封装好的引入,结果报下图错误,但是图片照常显示
3.最后找到back ,去掉标签中的back图片加载恢复正常,报错消失,于是确定问题为没有封装back的方法
4.最后在封装的组件里添加back与back的方法,所有功能恢复正常,bug修复完毕,以下是修复后的代码
-
{{name}}



