步驟
1.導入store模塊
2.獲取state
3.獲取state中的變量
import store from "@/store";
const state = store.getState();
console.log(state.myVar);
1.導入store模塊
2.獲取state
3.獲取state中的變量
import store from "@/store";
const state = store.getState();
console.log(state.myVar);