mamahaha
V2EX  ›  Vue.js

请教一下 vue 里边用 localstroge 等前台数据存储时, get 数据时是在生命周期钩子里调用吗?

  •  
  •   mamahaha · Mar 8, 2019 · 2203 views
    This topic created in 2650 days ago, the information mentioned may be changed or developed.

    我把 8 个钩子都试了一遍,貌似加载不出来啊? 现在是用 watch 监控某个 input,敲个字就能载前台数据,但是这样很不专业啊。

    2 replies    2019-03-14 19:55:35 +08:00
    mamahaha
        1
    mamahaha  
    OP
       Mar 9, 2019
    研究了 2 天终于解决了,感觉学 vue 的人不多啊.
    ghostheaven
        2
    ghostheaven  
       Mar 14, 2019 via Android
    我是在 router 的 before 和 update 加载数据,还有 app 的 created 加载
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3130 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:44 · PVG 21:44 · LAX 06:44 · JFK 09:44
    ♥ Do have faith in what you're doing.