0
採取這種代碼創建元素動態
<app-localstorage-document key="search" data="{{plAppLoader}}"> </app-localstorage-document>
數據屬性將總是當它改變,更新並保存到本地存儲,並期待在控制檯中,對象的字符串表示被示出與鍵和價值觀,基本上是整個結構。
導入和創建這個動態
var ALD = document.createElement('app-localstorage-document');
Polymer.dom(ALD).setAttribute('key', 'plAppLoader');
Polymer.dom(ALD).setAttribute('data', this.plAppLoader);
Polymer.dom(this.$.contentWrapper).appendChild(ALD);
據更新上的變化,但看着該控制檯,它顯示
「的翻譯:」
哪讓我想知道它是否像第一個選項那樣得到保存,即,即使它在控制檯日誌中顯示「[object Object]」,我仍然可以將原始數據檢索爲obj從本地存儲等。