Vuex $store properties not reactive when using computed property

后端 未结 6 520
孤街浪徒
孤街浪徒 2020-12-29 23:03

I have a Vuex store, which I\'m injecting into my instance:

import store from \'../store\';

const mainNav = new Vue({
  el: \'#main-nav\',
  store,
  compon         


        
6条回答
  •  醉话见心
    2020-12-29 23:09

    This was my problem.

      const store = new Vuex.Store({
        state: {
          isTrackPlaying: false,
        },
      ...
      });
    

    I forgot to set the initial state and now it is reactive.

提交回复
热议问题