摘要:
js // actions:方法 异步 actions: { fnac1(context) { // context就是仓库 // 异步代码 setTimeout(() = { const numNew = 200 // 在异步有结果的位置,把结果提交给mutations的方法 context.co 阅读全文
摘要:
html {{$store.state.count}} js computed: { count() { return this.$store.state.count; }, js computed:{ ...mapState(["count"]) } // 视图中{{count}} js gett 阅读全文