From c93cf1a84e37c0494487bc57144d17f2ad42e373 Mon Sep 17 00:00:00 2001 From: Hasin Hayder Date: Sat, 16 Jan 2021 21:00:44 +0600 Subject: [PATCH] Fix for Vue3 - Now it works with Vue3 #27 --- src/switches.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/switches.vue b/src/switches.vue index f062474..672c2a1 100644 --- a/src/switches.vue +++ b/src/switches.vue @@ -6,7 +6,7 @@ - +
@@ -16,13 +16,12 @@ export default { name: 'switches', - props: { typeBold: { default: false }, - value: { + modelValue:{ default: false }, @@ -57,24 +56,24 @@ export default { mounted () { if(this.emitOnMount) { - this.$emit('input', this.value) + this.$emit('update:modelValue', this.modelValue) } }, methods: { trigger (e) { - this.$emit('input', e.target.checked) + this.$emit('update:modelValue', e.target.checked) } }, computed: { classObject () { - const { color, value, theme, typeBold, disabled } = this; + const { color, modelValue, theme, typeBold, disabled } = this; return { 'vue-switcher' : true, - ['vue-switcher--unchecked'] : !value, + ['vue-switcher--unchecked'] : !modelValue, ['vue-switcher--disabled'] : disabled, ['vue-switcher--bold']: typeBold, ['vue-switcher--bold--unchecked']: typeBold && !value,