javascript - 如何使用 Mapstate 映射此数据
问题描述
我可以从this.$store.state.workermanage.staff.staff
但是如何使用 ...mapstate 交换此代码,谢谢
persons: this.$store.state.workermanage.staff.staff
解决方案
computed: {
...mapState({ persons: state => state.workermanage.staff.staff })
}
并使用如下:
{{ persons }}
推荐阅读
- mysql - 此查询中我的 MySQL 语法有什么问题?
- boolean-algebra - 为什么在这张卡诺图中没有考虑 D 为常数的突出显示区域?
- shell - zsh shell 问题,特别是当我试图获取输出时
- flutter - 当我显示重叠元素时如何使我的页面可滚动,其中有太多的项目在颤动?
- node.js - DynamoDB BatchGet 总是给出“提供的关键元素与架构不匹配”
- python-3.x - 如何通过传入 True 或 False 变量来停止无限循环中的线程?
- excel - 在 For 循环中使用 MonthName 函数时出现运行时错误
- java - 如何在包含的 JSP 上访问请求属性
- java - Mockito 使用 Mockito.mockStatic() 模拟静态 void 方法
- development-environment - 找出在哪个 MMT 源文件中声明了一个常量/理论/...