mamahaha
V2EX  ›  Vue.js

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

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

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

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