首先安装vuex 这个不说了 大家都会
新建store.js来存放vuex的方法这个大家也都会
接下来在用的时候 引入
import {mapGetters,mapActions} from 'Vuex'
mapActions 传递函数
mapGetters 从store中获取
- main.js

- app.js

- store.js

首先安装vuex 这个不说了 大家都会
新建store.js来存放vuex的方法这个大家也都会
接下来在用的时候 引入
import {mapGetters,mapActions} from 'Vuex'
mapActions 传递函数
mapGetters 从store中获取
本文标题:vuex的使用方法
本文链接:https://www.haomeiwen.com/subject/twdorxtx.html
网友评论