|
页面为stml
定义的data代码为:
data() {
return {
nameStr:"默认值",
};
},
取值方法一: 直接通过this. 取值 无效
aMap.getLocation(function(ret, err) {
if (ret.status) {
this.nameStr = "1";
}
});
取值方法二: 通过this重新引用,取值无效
var that = this;
aMap.getLocation(function(ret, err) {
if (ret.status) {
that .nameStr = "1";
}
});
请问应该用什么方法取值
|
|