為 Ember JS 找到1 篇文章

如何在伺服器同步可用時使 Ember.js 應用程式離線?

Arjun Thakur
更新於 25-6-2020 07:55:53

103 次瀏覽

使用 ember-localstorage 介面卡。App.store = DS.Store.create({    revision: 11,    adapter: DS.LSAdapter.create() });示例您需要定義打算用於客戶端儲存的介面卡 - App.Store = DS.SyncStore.extend({    revision: 10,    adapter: DS.IndexedDB.adapter({       mappings: {          person: App.Person,          persons: App.Person,          contact: App.Contact,          contacts: App.Contact       }    }) });

1
廣告
© . All rights reserved.