知道哪个从属键导致计算的属性更改 [英] Know which among the dependent keys caused the computed property change

查看:79
本文介绍了知道哪个从属键导致计算的属性更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Ember中,是否有一种方法可以获取依赖键中的哪些键导致重新计算计算的属性?

In Ember, is there a way to get which among the dependent keys caused a computed property to recalculate?

例如:

myProp: Ember.computed('dep1','dep2','dep3', function(){
    console.log('MyProp was recalculated due to a change in property :' <dep 1,2 or 3(get the value here)>);
    return ...;
}),

请告诉我是否需要提供其他详细信息。

Kindly let me know if I should provide any additional details.

推荐答案

简短答案:不,那不可能。

Short answer: No, thats not possible.

长答案:您可以保存所有依赖项键并在重新计算时对其进行比较。

Long answer: You could save away all dependency keys and compare them on recalculation.

这篇关于知道哪个从属键导致计算的属性更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆