
本文共 1940 字,大约阅读时间需要 6 分钟。
������ store.js
���������������������vuex��������������������������������������� Vue
��� Vuex
������������������������������������������������������������������������������������������������������������������������������ ager
��������� parStore
���������������������������������������������������
Modules/ager.js
������������
ager
������������������������������������������������������������������������������������������������������
tabs
������������������������������������������������addTab(state, tab)
������������������������tabs
������
addTabAsync
������������������������������������������������@/pages/par/store
������������
parStore
������������������������par
���������������������������������
id
��� tabs
������ager
��������������������� addTab
������addTabAsync
���������������������������������Vuex
���������������������������vuex���������������������������������������������������������������store���������
import { createNamespacedHelpers } from 'vuex';const { mapState, mapActions } = createNamespacedHelpers('store');
������������������������ computed
���������������������������
computed: { id() { return this.mapState({ id: state => state.id }); }},methods: { addTabAsync() { return this.mapActions(['addTabAsync']); }}
��������������������������������������� mapState
��� mapActions
������������������������������������������������
// ������const { panes: { id }, currentId } = createNamespacedHelpers('ager/parStore');
������������������������������������������ this.id
������ panes
������������ id
������������������ addTabAsync
������������������������������
���������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
