How to update chart when state changes in vue?
问题 I've mapped chartData to a state property using vuex. What I'd like to do is update the chart when a dataset is updated. I have heard that it can be done with mixins or watchers but I don't know how to implement it. I understand that mixins creates a watcher but I don't know how it is used within vuex. Chartline.vue: <script> import { Line } from 'vue-chartjs' import { mapState } from 'vuex' export default { name: 'ChartLine', extends: Line, computed:{ ...mapState(['charData','options']) },