some async/await are written in the action of vuex, and some are written in the .vue file method. Where should I write it?
some async/await are written in the action of vuex, and some are written in the .vue file method. Where should I write it?
this mainly depends on whether your data is used in the current component or whether it needs to be shared by multiple components. If the component is exclusive, put it in .vue, on the contrary, put it in vuex
action can do asynchronous operation. Split it out as much as possible, and don't put it in .vue
.Previous: Python experts enter, rookies ask for advice on the implementation of a python code for a problem