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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.0.99",
4
+ "version": "0.0.101",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -11,7 +11,8 @@
11
11
  class="th-grid-item-content"
12
12
  :class="`th-grid-item-content_${position}`"
13
13
  >
14
- <i v-if="isIcon" :class="['th-icon', icon]"></i>
14
+ <slot v-if="$slots.icon" name="icon"></slot>
15
+ <i v-else-if="isIcon" :class="['th-icon', icon]"></i>
15
16
  <img v-else class="th-grid-item-img" src="" alt="" />
16
17
  <slot v-if="$slots.title" name="title"></slot>
17
18
  <p v-else class="th-grid-item-title">{{ title }}</p>
@@ -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.data.records;
356
+ data = res.records;
357
357
  this.tableConfig.pageInfo.options.total = Number(res.data.total);
358
358
  } else {
359
- data = res.data;
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
  });