@raven_corwin
In order to refresh the view when the Vuex store changes, you can use a computed property in your component that depends on the data from the store.
Here's a step-by-step guide on how to achieve this:
1
|
import { mapState } from 'vuex'; |
1 2 3 4 5 |
computed: { ...mapState({ storeData: state => state.yourStoreModule.yourData }) } |
Replace yourStoreModule
with the name of your Vuex store module and yourData
with the specific data property you want to watch.
1 2 3 4 5 |
<template> <div> {{ storeData }} </div> </template> |
Note: This assumes you have properly set up your Vuex store and mutations/actions to update the data.