• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yantianqi
V2EX  ›  程序员

vuex 的一个问题

  •  
  •   yantianqi · Jun 30, 2017 · 2538 views
    This topic created in 3252 days ago, the information mentioned may be changed or developed.

    vuex 中
    this.$store.dispatch 和 this.$store.commit 有什么区别
    谢谢

    4 replies    2017-06-30 13:22:46 +08:00
    LeeSeoung
        1
    LeeSeoung  
       Jun 30, 2017   ❤️ 1
    371657110
        2
    371657110  
       Jun 30, 2017
    看文档啊..老铁
    fl0at
        3
    fl0at  
       Jun 30, 2017
    1.X 和 2.X 的区别
    Zhongwei
        4
    Zhongwei  
       Jun 30, 2017
    - dispatch 是调用 action
    - commit 是调用 mutation

    老铁,action 与 mutation 的关系及不同使用场景,你需要看一下官方文档
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3430 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 10:45 · PVG 18:45 · LAX 03:45 · JFK 06:45
    ♥ Do have faith in what you're doing.