<script setup>
import { useStore } from 'vuex'
const store = useStore()

store.commit('watchRouterPath', arr);
</script>
import { createStore } from 'vuex'

export default createStore({
  state: {
    cont: 0
  },
  mutations: {
    watchRouterPath(state, arr) {
      state.cont++
      console.log(arr);
    }
  },
  actions: {
  },
  modules: {
  }
})

Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐