Vue.js-Vuex 更新未反映在组件 DOM 中的状态内部数组中的对象 [英] Vue.js- Vuex updating an object within an array inside state not reflected in component DOM

查看:38
本文介绍了Vue.js-Vuex 更新未反映在组件 DOM 中的状态内部数组中的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Vuex/商店:

从'vue'导入Vue;从 'vuex' 导入 Vuex;Vue.use(Vuex);const store = new Vuex.Store({状态: {待办事项: [{id: 1, text: 'Clean kitchen', done: false},{id: 2, text: '干净的卧室', done: false},{id: 3, text: '清洁浴室', done: false},{id: 3, text: '干净的衣服', done: true},],},突变:{x(状态,数据){state.todos[0] = 数据;}},});导出默认商店;

Test.vue :