regularjs/regular

computed计算问题

Closed this issue · 1 comments

d2如果没有在模板中进行数据绑定,d2是不会计算的。怎样才能不在模板中绑定的情况下,让d2会计算。js中怎么去实现?
image

image

this.$get( 'd2' )

如果d2没在模板中使用的话,应该换种写法,不要使用computed

this.$watch( 'a', function () {
    // your logic...
} );