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

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.

主站蜘蛛池模板: 嘉荫县| 剑川县| 宜昌市| 旺苍县| 贵南县| 裕民县| 棋牌| 抚远县| 广德县| 五华县| 眉山市| 玛多县| 霍城县| 和政县| 钦州市| 宁乡县| 巨野县| 东至县| 武强县| 大关县| 民权县| 南陵县| 磐石市| 家居| 都江堰市| 什邡市| 茌平县| 金湖县| 河北区| 收藏| 黄梅县| 河津市| 永福县| 朝阳市| 安多县| 东海县| 南江县| 平谷区| 晋江市| 三原县| 托里县|