Pokemon123
V2EX  ›  问与答

vue 中使用 echarts,当发生路由跳转的时候,再跳转回来, echarts 就消失不见了,这是为什么?

  •  
  •   Pokemon123 · Oct 27, 2020 · 2830 views
    This topic created in 2202 days ago, the information mentioned may be changed or developed.
    6 replies  •  2020-10-27 20:47:01 +08:00
    nbin2008
    nbin2008
    Oct 27, 2020
    1
    beforeRouteEnter (to, from, next) {
    next(vm => {
    // 通过 `vm` 访问组件实例,试试在这里初始化 echarts
    })
    }
    LabJo
    LabJo
    Oct 27, 2020
    2
    盲猜一个要手动 resize
    qqqq11
    qqqq11
    Oct 27, 2020
    3
    上代码
    dinjufen
    dinjufen
    Oct 27, 2020
    4
    没组件缓存?没代码也只能猜
    wszgrcy
    wszgrcy
    Oct 27, 2020 via Android
    5
    ………这还用猜,你写一个 canvas,要是路由跳转后返回还能保存就怪了……
    codingguy
    codingguy
    Oct 27, 2020
    6
    跳走的时候组件不是销毁了吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1473 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 04:22 · PVG 12:22 · LAX 20:22 · JFK 23:22
    ♥ Do have faith in what you're doing.