kgloveyou
V2EX  ›  问与答

mounted()和通过 ...mapState 实现的 computed 执行顺序

  •  
  •   kgloveyou · Aug 7, 2018 · 2806 views
    This topic created in 2842 days ago, the information mentioned may be changed or developed.
    computed:{
    ...mapState(mapStore.name, ['mapInstance']),
    ...mapState(mapStore.name, ['mapConfig']),
    },
    利用上述代码从 store 中读取了 computed 属性值
    mounted(){
    if(this.mapInstance){
    ...
    }
    },
    在 mounted 中却获取不到 mapInstance,提示未定义。
    这里该怎么读取?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3117 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 12:39 · PVG 20:39 · LAX 05:39 · JFK 08:39
    ♥ Do have faith in what you're doing.