解决Vue方法中setTimeout改变变量的值无效

把data里的变量继承过来重新封装一下

let that = this;

this.rightAnswer = false;

setTimeout(function() {

      that.rightAnswer = true;

}, 1500)

posted @ 2017-02-07 14:41  SKILL·NULL  阅读(4754)  评论(0编辑  收藏  举报