2.0.0-alpha.0 • Published 3 years ago
@yzfe/vuex-helper v2.0.0-alpha.0
vuex 的辅助函数
主要是 写 getter, mutation, action 的时候可以提供类型 推导
使用
import { getter, mutation, action, decorator } from '@app/vuex-helper'
/*** state ***/
let state = {
name: 'Allenice'
}
/*** getters ***/
let getters = getter(state, {})
/*** mutations ***/
let mutations = mutation(state, {})
/*** actions ***/
let actions = action(state, {})
/*** module store ***/
let store = {
namespaced: true,
state,
getters,
mutations,
actions
}