November 2017
Beginner to intermediate
398 pages
8h 42m
English
The other way is to initialize the content data property with the restored value directly:
new Vue({
// ...
data () {
return {
content: localStorage.getItem('content') || 'You can write in **markdown**',
}
},
// ...
})
With the preceding code, the watcher handler will not be called because we initialize the content value instead of changing it.
Read now
Unlock full access