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.
- package/le-list/src/main.vue +9 -3
- package/package.json +1 -1
package/le-list/src/main.vue
CHANGED
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
<slot name="rowBtnStand" :scope="scope">
|
|
68
68
|
<le-button
|
|
69
69
|
@click="editItem(scope.row)"
|
|
70
|
-
v-if="
|
|
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="
|
|
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) {
|