刚进入点击编辑可改成完成,再点完成就报错了,
https://ask.dcloud.net.cn/question/71175 这个链接我看的不是很懂,试了没弄出来,希望有具体的案例,非常感谢
onNavigationBarButtonTap(e) {
console.log(e)
const index = e.index;
console.log(this)
console.log(this.$mp.page)
if (index === 0) {
if (e.text === "编辑") {
var currentWebview = this.$mp.page.$getAppWebview();
currentWebview.setTitleNViewButtonStyle(0, {
text: "完成",
});
// this.titleNViewWebview()
this.showChecked = true;
} else {
var currentWebview = this.$mp.page.$getAppWebview();
currentWebview.setTitleNViewButtonStyle(0, {
text: "编辑",
});
// this.titleNViewWebview()
this.showChecked = false;
}
}
},
报错
[Vue warn]: Property or method "toJSON" 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.
15:10:46.897 (found in pages/my/family)