2022-03-01 vue data中的变量通过this.赋值时,只能响应赋值一次,第二次之后赋值都没变化,有时会重置变量值为空(vue + uniapp 微信开发者工具端调试)

代码:
view:
单位{{_unitName}}
js:
// 选择单位
selectUnit(e) {
this._unitName = e.name;
this._unitId = e.id;
console.log(e.name);
console.log(this._unitName);
}
排错过程:更换了其它变量名就可以了
原因:程序不识别以下划线开头的变量名(???!)

posted @ 2022-04-01 09:47  叶乘风  阅读(850)  评论(0编辑  收藏  举报