在这里,我填的阵列打印值localStorage
:无法从对象
let storageObj = {};
storageObj.date = (new Date().toLocaleString().replace(", ","T"));
storageObj.url = this.responseURL;
localStorage.setItem(storageObj.date, storageObj.url);
在mounted()
我是从localStorage
像遍历所有的数据:
for(let obj of Object.entries(localStorage))
{
this.lastpasts.push(obj);
}
而且每个配售对象对lastpasts
(位于data() {lastpasts : []}
)。
在模板我只想url
打印:
<div class="ui divided items" v-for="el in lastpasts">
<div class="item">
{{el.url}}
</div>
</div>
但这种代码不打印什么。仅工作{{el}}
。它的打印在HTML块:
[ "24.06.2017T11:55:10", "362e9cc5-e7e6" ]
[ "24.06.2017T12:26:47", "b0f9f20d-7851" ]
浏览器控制台没有任何错误。
能否请你放的'的console.log(EL)的结果' ? –
'的ReferenceError:1:13' –
噢,对不起EL不是在定义。我的错。 'console.log(lastpasts)'(或lastposts?) –