官术网_书友最值得收藏!

Initializing directly in the data

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.

主站蜘蛛池模板: 花垣县| 富裕县| 南陵县| 亚东县| 建昌县| 满城县| 鄂温| 宜川县| 佛冈县| 黑龙江省| 齐河县| 阜新| 武冈市| 桦川县| 涿鹿县| 博乐市| 蒲江县| 朔州市| 油尖旺区| 夏津县| 阳山县| 南华县| 普洱| 根河市| 凭祥市| 兰溪市| 宁阳县| 潞西市| 贵南县| 邵武市| 凭祥市| 河源市| 措美县| 贵港市| 乌兰县| 紫阳县| 房产| 天门市| 衡水市| 内丘县| 玛纳斯县|