tianheng-ui 0.0.99 → 0.0.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ const getters = {
2
+ // 表单设计
3
+ selectFormItem: state => state.makingForm.selectFormItem
4
+ };
5
+ export default getters;
@@ -0,0 +1,21 @@
1
+ const state = {
2
+ selectFormItem: null
3
+ };
4
+
5
+ const mutations = {
6
+ SELECT_FORM_ITEM: (state, data) => {
7
+ state.selectFormItem = data;
8
+ }
9
+ };
10
+
11
+ const actions = {
12
+ selectFormItem({ commit }) {
13
+ commit("SELECT_FORM_ITEM");
14
+ }
15
+ };
16
+
17
+ export default {
18
+ state,
19
+ mutations,
20
+ actions
21
+ };
@@ -0,0 +1,26 @@
1
+ import Vue from 'vue'
2
+ import Vuex from 'vuex'
3
+ import getters from './getters'
4
+
5
+ Vue.use(Vuex)
6
+
7
+ // https://webpack.js.org/guides/dependency-management/#requirecontext
8
+ const modulesFiles = require.context('./modules', true, /\.js$/)
9
+
10
+ // you do not need `import app from './modules/app'`
11
+ // it will auto require all vuex module from modules file
12
+ const modules = modulesFiles.keys().reduce((modules, modulePath) => {
13
+
14
+ // set './app.js' => 'app'
15
+ const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
16
+ const value = modulesFiles(modulePath)
17
+ modules[moduleName] = value.default
18
+ return modules
19
+ }, {})
20
+
21
+ const store = new Vuex.Store({
22
+ modules,
23
+ getters
24
+ })
25
+
26
+ export default store