gpt4 book ai didi

javascript - ArrayController.addObjects 之后的 Emberjs Hook 称为 EmberJs 1.0.0

转载 作者:行者123 更新时间:2023-11-28 08:49:21 26 4
gpt4 key购买 nike

我有一条使用 ArrayController 来显示对象的路线。在执行某些操作后,使用 controller.clear()controller.addObjects() 方法再次填充数组。我需要知道新闻对象何时被渲染,以便我可以重新计算一些动画。

didInsertElement 回调在第一次渲染对象时起作用,但在 addObjects() 之后似乎不会再次触发它。

我如何知道 addObjects() 何时完成渲染?

谢谢

最佳答案

您可能只需观察 Controller 的内容并触发您的重新计算功能。

伪示例:

App.PostsController = Ember.ArrayController.extend({
recalculateStuff: function() {
// do your recalculations here
}.property('content.[]')
});

希望有帮助。

关于javascript - ArrayController.addObjects 之后的 Emberjs Hook 称为 EmberJs 1.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19344791/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com