Vuex: Access State From Another Module

后端 未结 6 780
走了就别回头了
走了就别回头了 2021-01-30 08:12

I want to access state.session in instance.js from records_view.js. How is this accomplished?

store/modules/instance.js

6条回答
  •  余生分开走
    2021-01-30 08:41

    this.$store.state.instance.session
    

    where "instance" is the module name and "session" is the Vuex state variable you're trying to access.

提交回复
热议问题