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 + '' } } }