gpt4 book ai didi

ember.js - DEPRECATION : The default behavior of shouldReloadAll will change in Ember Data 2. 0 当至少有一个时始终返回 false

转载 作者:行者123 更新时间:2023-12-02 13:08:15 24 4
gpt4 key购买 nike

在提出这个问题时,我正在运行最新的 Ember 和 Ember Data 版本。

enter image description here

我正在使用 DS.RESTAdapter 以这种方式调用 /places:

this.store.findAll('place');

模型只有一个名称属性name: DS.attr('string')JSON 如下:

{
places: [
{
id: 1,
name: "San Francisco"
},
{
id: 2,
name: "Havana"
}
]
}

我制作了模板并使用了相应的each,到目前为止一切都显示并正常工作,但我收到了一个弃用警告,内容如下:

DEPRECATION: The default behavior of shouldReloadAll will change in Ember Data 2.0 to always return false when there is at least one "destination" record in the store. If you would like to preserve the current behavior please override shouldReloadAll in your adapter:application and return true.

我不知道解决此警告的最佳方法是什么。我是 ember 的新手,所以任何进一步的解释都可以。提前致谢。

最佳答案

设置shouldReloadAll() { return true; } 在您的应用程序适配器中,警告消失,当前的默认行为是相同的。

关于ember.js - DEPRECATION : The default behavior of shouldReloadAll will change in Ember Data 2. 0 当至少有一个时始终返回 false,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31016676/

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