目录
store
---index.js
pages
index.js
store--index
1.const action ={
async golist (a){
a('b',result.data)
}
}
// state vuex的state ,c一个自定义属性
2.const mutations={
b(state,c){
state.c=c
}
}
store-index.js
import {mapState} from 'vuex'
computed:{
...mapState({c:state=>c.index.c})
}