摘要: js // actions:方法 异步 actions: { fnac1(context) { // context就是仓库 // 异步代码 setTimeout(() = { const numNew = 200 // 在异步有结果的位置,把结果提交给mutations的方法 context.co 阅读全文
posted @ 2019-08-07 00:29 193557749 阅读(198) 评论(0) 推荐(0)
摘要: html {{$store.state.count}} js computed: { count() { return this.$store.state.count; }, js computed:{ ...mapState(["count"]) } // 视图中{{count}} js gett 阅读全文
posted @ 2019-08-07 00:27 193557749 阅读(222) 评论(0) 推荐(0)