SOURCE

function createStore({state,mutations}){
    return new vue={
        data:{
           state
        },
        methods:{
            commint(mutationType){
              return  mutations[mutationType](this.state)
            }
        }

    }
}
const store = createStore({
    state:{count:0},
    mutations:{
        inc(state){
        state.count++
    }}
})

const Counter={
    render (h){
        return h('div',store.state.count)
    }
}
new Vue({
    el:'#app',
    components:{Conter},
    methods:{
        inc(){
            store.commit('inc')
        }
    }
})
console 命令行工具 X clear

                    
>
console