From f966827fdcad291b379f2a6316e4d9acb6ffbfa9 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Thu, 28 May 2020 13:17:32 +0800 Subject: [PATCH] fix(base-selection): clearable when disabled --- src/_base/Selection/src/main.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/_base/Selection/src/main.vue b/src/_base/Selection/src/main.vue index 082499f62..db5e0cee0 100644 --- a/src/_base/Selection/src/main.vue +++ b/src/_base/Selection/src/main.vue @@ -43,7 +43,7 @@ :arrow="showArrow" :disabled="disabled" :active="active" - :clearable="clearable && selected" + :clearable="syntheticClearable && selected" @clear="handleClear" /> @@ -99,7 +99,7 @@ :theme="theme" :disabled="disabled" :active="active" - :clearable="clearable && selected" + :clearable="syntheticClearable && selected" :loading="loading" @clear="handleClear" /> @@ -138,7 +138,7 @@ :arrow="showArrow" :disabled="disabled" :active="active" - :clearable="clearable && selected" + :clearable="syntheticClearable && selected" @clear="handleClear" /> @@ -170,7 +170,7 @@ :arrow="showArrow" :disabled="disabled" :active="active" - :clearable="clearable && selected" + :clearable="syntheticClearable && selected" :loading="loading" @clear="handleClear" /> @@ -255,8 +255,11 @@ export default { } }, computed: { + syntheticClearable () { + return this.clearable && !this.disabled + }, showArrow () { - if (!this.clearable) return true + if (!this.syntheticClearable) return true else return !(this.hover && this.selected) }, labelPlaceholder () {