Rename some attrs etc. for buefy components used with oruga

This commit is contained in:
Lance Edgar 2024-05-06 22:56:47 -05:00
parent 3d319cbd09
commit f0d694cfe5

View file

@ -23,7 +23,7 @@
<%def name="make_b_autocomplete_component()"> <%def name="make_b_autocomplete_component()">
<script type="text/x-template" id="b-autocomplete-template"> <script type="text/x-template" id="b-autocomplete-template">
<o-autocomplete v-model="buefyValue" <o-autocomplete v-model="orugaValue"
:data="data" :data="data"
:field="field" :field="field"
:open-on-focus="openOnFocus" :open-on-focus="openOnFocus"
@ -32,7 +32,7 @@
:clear-on-select="clearOnSelect" :clear-on-select="clearOnSelect"
:formatter="customFormatter" :formatter="customFormatter"
:placeholder="placeholder" :placeholder="placeholder"
@update:model-value="buefyValueUpdated" @update:model-value="orugaValueUpdated"
ref="autocomplete"> ref="autocomplete">
</o-autocomplete> </o-autocomplete>
</script> </script>
@ -52,13 +52,13 @@
}, },
data() { data() {
return { return {
buefyValue: this.modelValue, orugaValue: this.modelValue,
} }
}, },
watch: { watch: {
modelValue(to, from) { modelValue(to, from) {
if (this.buefyValue != to) { if (this.orugaValue != to) {
this.buefyValue = to this.orugaValue = to
} }
}, },
}, },
@ -67,7 +67,7 @@
const input = this.$refs.autocomplete.$el.querySelector('input') const input = this.$refs.autocomplete.$el.querySelector('input')
input.focus() input.focus()
}, },
buefyValueUpdated(value) { orugaValueUpdated(value) {
this.$emit('update:modelValue', value) this.$emit('update:modelValue', value)
}, },
}, },
@ -174,8 +174,8 @@
<%def name="make_b_datepicker_component()"> <%def name="make_b_datepicker_component()">
<script type="text/x-template" id="b-datepicker-template"> <script type="text/x-template" id="b-datepicker-template">
<o-datepicker :name="name" <o-datepicker :name="name"
v-model="buefyValue" v-model="orugaValue"
@update:model-value="buefyValueUpdated" @update:model-value="orugaValueUpdated"
:value="value" :value="value"
:placeholder="placeholder" :placeholder="placeholder"
:date-formatter="dateFormatter" :date-formatter="dateFormatter"
@ -203,18 +203,18 @@
}, },
data() { data() {
return { return {
buefyValue: this.modelValue, orugaValue: this.modelValue,
} }
}, },
watch: { watch: {
modelValue(to, from) { modelValue(to, from) {
if (this.buefyValue != to) { if (this.orugaValue != to) {
this.buefyValue = to this.orugaValue = to
} }
}, },
}, },
methods: { methods: {
buefyValueUpdated(value) { orugaValueUpdated(value) {
if (this.modelValue != value) { if (this.modelValue != value) {
this.$emit('update:modelValue', value) this.$emit('update:modelValue', value)
} }
@ -329,7 +329,7 @@
<script type="text/x-template" id="b-input-template"> <script type="text/x-template" id="b-input-template">
<o-input :type="type" <o-input :type="type"
:disabled="disabled" :disabled="disabled"
v-model="buefyValue" v-model="orugaValue"
@update:modelValue="val => $emit('update:modelValue', val)" @update:modelValue="val => $emit('update:modelValue', val)"
:autocomplete="autocomplete" :autocomplete="autocomplete"
ref="input"> ref="input">
@ -347,13 +347,13 @@
}, },
data() { data() {
return { return {
buefyValue: this.modelValue orugaValue: this.modelValue
} }
}, },
watch: { watch: {
modelValue(to, from) { modelValue(to, from) {
if (this.buefyValue != to) { if (this.orugaValue != to) {
this.buefyValue = to this.orugaValue = to
} }
}, },
}, },