首页 > 其他 > 详细

vuex

时间:2019-06-29 09:57:45      阅读:81      评论:0      收藏:0      [点我收藏+]

vuex 五步走:

  1. npm  install vue  -S

  2. vue.use(Vuex)

  3. 创建一个store模块,定义状态管理的规则 state,mutations,actions,getters,module

  4. 把store模块注册到viewmodel

  5. this.$store 来访问这个 store

    mapGetters把store中的getter方法映射到组建中的computer属性上

    mapActions

    mapMutations

    mapState

    dispatch("事件")

vuex

原文:https://www.cnblogs.com/manban/p/11105437.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!