leisure-core 0.6.88 → 0.6.89

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.
@@ -67,13 +67,13 @@
67
67
  <slot name="rowBtnStand" :scope="scope">
68
68
  <le-button
69
69
  @click="editItem(scope.row)"
70
- v-if="disBtn === 'edit'"
70
+ v-if="getBtnType(scope.row) === 'edit'"
71
71
  >
72
72
  {{ editBtnText }}</le-button
73
73
  >
74
74
  <le-button
75
75
  @click="detail(scope.row)"
76
- v-if="disBtn === 'detail'"
76
+ v-if="getBtnType(scope.row) === 'detail'"
77
77
  >
78
78
  {{ detailBtnText }}</le-button
79
79
  >
@@ -193,7 +193,7 @@ export default {
193
193
  default: "标题",
194
194
  },
195
195
  disBtn: {
196
- type: String,
196
+ type: [String, Function],
197
197
  default: "edit",
198
198
  },
199
199
  showChecked: {
@@ -373,6 +373,12 @@ export default {
373
373
  this.getList();
374
374
  });
375
375
  },
376
+ getBtnType(row) {
377
+ if (typeof this.disBtn === "function") {
378
+ return this.disBtn(row); // 调用父组件传入的函数,传入当前行数据
379
+ }
380
+ return this.disBtn; // 兼容旧的字符串写法
381
+ },
376
382
  customItem(rowData) {
377
383
  this.handleStatus = 2;
378
384
  if (rowData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.6.88",
3
+ "version": "0.6.89",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",