From 53cde520276af98a9b2b20cd0e8acf7bde768e70 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 27 Mar 2022 14:16:23 +0300 Subject: [PATCH] fix font control --- src/components/font_control/font_control.js | 9 +++++---- src/components/font_control/font_control.vue | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/font_control/font_control.js b/src/components/font_control/font_control.js index 24bad937..92ee3f30 100644 --- a/src/components/font_control/font_control.js +++ b/src/components/font_control/font_control.js @@ -6,11 +6,12 @@ export default { Select }, props: [ - 'name', 'label', 'value', 'fallback', 'options', 'no-inherit' + 'name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit' ], + emits: ['update:modelValue'], data () { return { - lValue: this.value, + lValue: this.modelValue, availableOptions: [ this.noInherit ? '' : 'inherit', 'custom', @@ -22,7 +23,7 @@ export default { } }, beforeUpdate () { - this.lValue = this.value + this.lValue = this.modelValue }, computed: { present () { @@ -37,7 +38,7 @@ export default { }, set (v) { set(this.lValue, 'family', v) - this.$emit('input', this.lValue) + this.$emit('update:modelValue', this.lValue) } }, isCustom () { diff --git a/src/components/font_control/font_control.vue b/src/components/font_control/font_control.vue index 2006c7f6..f100c3a9 100644 --- a/src/components/font_control/font_control.vue +++ b/src/components/font_control/font_control.vue @@ -14,8 +14,8 @@ :id="name + '-o'" class="opt exlcude-disabled" type="checkbox" - :modelValue="present" - @input="$emit('update:modelValue', typeof value === 'undefined' ? fallback : undefined)" + :checked="present" + @change="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)" >