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.
- package/lib/theme-chalk/js/store/getters.js +5 -0
- package/lib/theme-chalk/js/store/modules/makingForm.js +21 -0
- package/lib/theme-chalk/js/store/store.js +26 -0
- package/lib/tianheng-ui.js +1 -1
- package/package.json +1 -1
- package/packages/GridItem/index.vue +2 -1
- package/packages/TableMaking/generateTable.vue +2 -2
- package/packages/index.js +14 -0
@@ -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
|