From 2ecf33b0927f77b259e7d98821240e389bc07fff Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 23 Apr 2020 21:05:55 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ListTable/formatters/ActionsFormatter.vue | 8 ++++---- src/views/users/UserList.vue | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/ListTable/formatters/ActionsFormatter.vue b/src/components/ListTable/formatters/ActionsFormatter.vue index ea158982c..da81d5912 100644 --- a/src/components/ListTable/formatters/ActionsFormatter.vue +++ b/src/components/ListTable/formatters/ActionsFormatter.vue @@ -96,8 +96,8 @@ export default { cleanedActions() { let actions = [...this.defaultActions, ...this.extraActions] actions = actions.map((v) => { - v.has = this.cleanAction(v, 'has') - v.can = this.cleanAction(v, 'can') + v.has = this.cleanBoolean(v, 'has') + v.can = this.cleanBoolean(v, 'can') v.callback = this.cleanCallback(v) return v }) @@ -111,12 +111,12 @@ export default { } }, methods: { - cleanAction(item, attr) { + cleanBoolean(item, attr) { const ok = item[attr] if (!ok || typeof ok !== 'function') { return item } - item.ok = function() { + item[attr] = function() { return ok(this.row, this.cellValue) } return item diff --git a/src/views/users/UserList.vue b/src/views/users/UserList.vue index 2fefef6ec..d9d36e3d3 100644 --- a/src/views/users/UserList.vue +++ b/src/views/users/UserList.vue @@ -42,7 +42,8 @@ export default { name: 'activeSelected', title: this.$tc('Active selected') } - ] + ], + hasCreate: false } } }