Vue.JS - how to use localstorage with Vue.JS

前端 未结 3 1371
梦谈多话
梦谈多话 2021-01-01 08:54

I am working on Markdown editor with Vue.JS, and I tried to use localstorage with it to save data but I don\'t know how to save new value to data variables in Vue.JS wheneve

3条回答
  •  一向
    一向 (楼主)
    2021-01-01 09:48

    you can use v-model to bind you variable with every change or you can put it computed :{} section.computed is like life hook of vue.js it re-render the component again when it values are changed.

提交回复
热议问题