commit: 同步操作【mutation 】
this.$store.commit('方法名',值)【存储】
-
this.$store.commit('newBankName', this.textValue)
this.$store.state.方法名【取值】
dispatch: 异步操作【Action】
this.$store.dispatch('方法名',值)【存储】
this.$store.getters.方法名【取值】
<template>
<div class="hello">
<h1>{
{ msg }}</h1>
<button @click="increment">按钮{
{doneTodos}}</button>
<button @click="incrementAsync">按钮new{
{doneTodos}}</button>
</div>
</template>
<script>
import { mapGetters ,mapActions,mapMutations} from 'vuex'
export default {
name: 'HelloWorld',
props: