1、定义一个self暂存this
2、再改变变量的值,则生效啦
var self=this;
this.toastrVal = inVal;
this.loadState = true;
this.noBg = bgState;
setTimeout(function () {
self.loadState = false;
}, 3000)
1、定义一个self暂存this
2、再改变变量的值,则生效啦
var self=this;
this.toastrVal = inVal;
this.loadState = true;
this.noBg = bgState;
setTimeout(function () {
self.loadState = false;
}, 3000)