tianheng-ui 0.0.54 → 0.0.55

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.54",
4
+ "version": "0.0.55",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -2,7 +2,7 @@
2
2
  <div class="th-table-action" @click.stop>
3
3
  <template v-for="(item, index) in actions">
4
4
  <el-popover
5
- v-if="item.act === 'delete'"
5
+ v-if="item.act === 'delete' && !btnHide(item)"
6
6
  :key="index"
7
7
  v-model="pop"
8
8
  placement="top"
@@ -32,7 +32,7 @@
32
32
  >
33
33
  </el-popover>
34
34
  <el-dropdown
35
- v-else-if="item.act === 'more'"
35
+ v-else-if="item.act === 'more' && !btnHide(item)"
36
36
  :key="index"
37
37
  :trigger="item.trigger || 'click'"
38
38
  :placement="item.placement || 'bottom-end'"
@@ -63,7 +63,7 @@
63
63
  </el-dropdown-menu>
64
64
  </el-dropdown>
65
65
  <el-button
66
- v-else
66
+ v-else-if="!btnHide(item)"
67
67
  :key="index"
68
68
  :style="item.style"
69
69
  :type="item.type"
@@ -107,13 +107,23 @@ export default {
107
107
  computed: {
108
108
  btnDisabled() {
109
109
  return item => {
110
- if (item.disabled instanceof Boolean) {
110
+ if (typeof item.disabled == "boolean") {
111
111
  return item.disabled;
112
112
  }
113
- if (item.disabled instanceof Function) {
113
+ if (typeof item.disabled == "function") {
114
114
  return item.disabled(this.scope);
115
115
  }
116
116
  };
117
+ },
118
+ btnHide() {
119
+ return item => {
120
+ if (typeof item.hide == "boolean") {
121
+ return item.hide;
122
+ }
123
+ if (typeof item.hide == "function") {
124
+ return item.hide(this.scope);
125
+ }
126
+ };
117
127
  }
118
128
  },
119
129
  methods: {
@@ -58,7 +58,7 @@
58
58
  :scope="scope"
59
59
  :option="item"
60
60
  />
61
- <span v-else-if="item.format">
61
+ <span v-else-if="item.formatTime">
62
62
  {{
63
63
  handleFormatTime(
64
64
  scope.row[item.alias || item.prop],
@@ -66,6 +66,9 @@
66
66
  )
67
67
  }}
68
68
  </span>
69
+ <span v-else-if="item.format">
70
+ {{ item.format(scope.row) }}
71
+ </span>
69
72
  <span v-else-if="item.alias">{{ scope.row[item.alias] }}</span>
70
73
  <span v-else>{{ scope.row[item.prop] }}</span>
71
74
  </template>