将对象推送到EmberJS数据存储

Push object to EmberJS Data Store

本文关键字:EmberJS 数据 存储 对象      更新时间:2023-09-26

我想知道如何在不使用适配器的情况下将记录推送到Ember Data Store。

现在,每次我使用this.store.push({type: type, data: data})时,存储都会将标志hasDirtyAttributes设置为true。

作为解决方法,我使用this.store.findRecord(type, id);从服务器更新记录,但我不需要它,因为data已经来自服务器。

您应该使用store.pushPayload添加数据以存储