tianheng-ui 0.0.100 → 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,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
|
package/package.json
CHANGED
@@ -353,10 +353,10 @@ export default {
|
|
353
353
|
this.tableConfig.loading.show = false;
|
354
354
|
let data = [];
|
355
355
|
if (this.tableConfig.pageInfo.show) {
|
356
|
-
data = res.
|
356
|
+
data = res.records;
|
357
357
|
this.tableConfig.pageInfo.options.total = Number(res.data.total);
|
358
358
|
} else {
|
359
|
-
data = res
|
359
|
+
data = res;
|
360
360
|
}
|
361
361
|
this.tableData = data;
|
362
362
|
})
|
package/packages/index.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import drawerStore from "../lib/theme-chalk/js/store/store";
|
2
|
+
|
1
3
|
/**
|
2
4
|
* Cell : 单元格
|
3
5
|
* Icons : 图标选择器
|
@@ -72,7 +74,19 @@ const components = [
|
|
72
74
|
Workflow
|
73
75
|
];
|
74
76
|
|
77
|
+
// 这一步判断window.Vue是否存在,因为直接引用vue.min.js, 它会把Vue绑到Window上,我们直接引用打包好的js才能正常跑起来。
|
78
|
+
if (typeof window !== "undefined" && window.Vue) {
|
79
|
+
window.Vue.component("v-drawer", components);
|
80
|
+
}
|
81
|
+
|
75
82
|
const install = function(Vue, opts = {}) {
|
83
|
+
if (!opts.store) {
|
84
|
+
console.log("Please provide a store!");
|
85
|
+
} else {
|
86
|
+
// 动态注册store
|
87
|
+
opts.store.registerModule("drawer", drawerStore);
|
88
|
+
}
|
89
|
+
|
76
90
|
components.forEach(component => {
|
77
91
|
Vue.component(component.name, component);
|
78
92
|
});
|