0👍
As it seems, at the time of initialisation of vue instance, there are no tasks saved in localStorage, but they are there later on.
I don’t see code to populate tasks variable when localStorage has tasks. as you are saying: once the state is work tasks exist
You can put watcher on state variable, and load the tasks, when this changes.
0👍
As I can see, your template has some errors:
-
Use
v-bind:class="{done: task.checked}" class="collection-item"
Instead of
v-bind:class="{done: task.checked} collection-item"
-
Remove the extra bracket from
{{{ task.text }}
You could use the uncompressed version (not the min.js
) during development, to get cool warnings!
- [Vuejs]-Vue.js i used 'v-once' in 'v-for' statement,why can't find 'item'?
- [Vuejs]-Vue v-radio on a previous invisible element
Source:stackexchange.com