vue.js - 更新 Vuex 存储中的数据而不是替换它
问题描述
我的 Nuxt store/index.js 文件中有以下数据:
export const state = () => ({
user: {
status: 'signedin',
data: {
'salutation': 'Mr',
'firstname': 'Test',
'lastname': 'Person',
'emailaddress': 'test@test.com'
}
}
});
我想更新“数据”部分中的某些值,但不更新其他值……例如,我想将“名字”更改为“大卫”,但其余数据保持不变。请有人能指出我正确的方向吗?
解决方案
推荐阅读
- grammar - 用列表扩展 Antlr 语法文件
- json - 将 JSON 发送到 Django 后端
- teradata - 如何通过 teradata 中的 bteq 导入从 csv 文件中导入记录,如果某些列有“,”作为文件中的值?
- python - Python套接字服务器登录系统不起作用
- html - 如何在angular js中进行基本的拖放
- vue.js - 子组件使用父组件数据重定向
- node.js - 只能使用 wget localhost 访问的端口
- python - Salt自定义颗粒和Python版本
- java - 使用并行流从 java 列表中获取 Pojo,而不使用任何类型的索引
- spring-boot - java.lang.NoClassDefFoundError: org/springframework/util/unit/DataSize 同时运行 spring boot 项目