how do I initialize state
how to use the network to request API?
const store = new Vuex.Store({
state: {
todos: [
{ id: 1, text: "...", done: true },
{ id: 2, text: "...", done: false }
]
},
I have a todos
in state, I want to initialize it by requesting API. How do I write it here?