Since you’re using the composition api, you should use the useStore
hook
import {useStore} from 'vuex'
export default {
setup(){
const store=useStore();
store.dispatch("action",payload);//instead of app.$store.dispatch("action",payload)
}
...
CLICK HERE to find out more related problems solutions.