From 1ad60752839e2073519506d61f99d64e93b3ac61 Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Mon, 6 Mar 2023 09:18:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20ESLint=E3=80=91src/components/je?= =?UTF-8?q?ro/JSwitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/components/jero/JSwitch.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/jero-web/src/components/jero/JSwitch.vue b/jero-web/src/components/jero/JSwitch.vue index 17c26136..410e1b5c 100644 --- a/jero-web/src/components/jero/JSwitch.vue +++ b/jero-web/src/components/jero/JSwitch.vue @@ -24,7 +24,7 @@ export default { name: 'JSwitch', props: { value: { - type: String | Number, + type: [String, Number], required: false }, disabled: { @@ -57,7 +57,6 @@ export default { }, // 透传给下级组件的事件,需要排除本组件使用的change事件 childListeners () { - const vm = this const result = Object.assign({}, this.$listeners ) @@ -74,11 +73,7 @@ export default { this.checkStatus = false this.$emit('change', this.options[1]) } else { - if (this.options[0] == val) { - this.checkStatus = true - } else { - this.checkStatus = false - } + this.checkStatus = this.options[0] + '' === val + '' } } }