regularjs / guide

regularjs's offcial guide
52 stars 19 forks source link

异步队列中改变data数据无法触发指令 #14

Closed Suzichen closed 6 years ago

Suzichen commented 6 years ago

代码如下:

// template
<div r-hide="!selecter" class="background"></div>
// js 组件部分
setTimeout(function () {
    this.data.selecter = '';
}.bind(this), 50);

异步函数中改变组件的data值,r-hide指令无法触发

Suzichen commented 6 years ago

this.$update()