migration(vue3): COMPONENT_V_MODEL

This commit is contained in:
axolotle 2024-03-14 13:39:11 +01:00
parent ad2f792e8b
commit 4f047d92d3
7 changed files with 18 additions and 20 deletions

View file

@ -11,8 +11,8 @@
<BFormInput <BFormInput
id="top-bar-search" id="top-bar-search"
:value="search" :modelValue="search"
@input="$emit('update:search', $event)" @update:modelValue="$emit('update:search', $event)"
:placeholder=" :placeholder="
$t('search.for', { items: $t('items.' + itemsName, 2) }) $t('search.for', { items: $t('items.' + itemsName, 2) })
" "

View file

@ -1,8 +1,7 @@
<template> <template>
<!-- FIXME vue3 - `modelValue`+`@update:model` doesn't work here, probably to the prop's name not being `value`. Sticking for now to `checked`+`@input` -->
<BFormCheckbox <BFormCheckbox
:checked="modelValue" :modelValue="modelValue"
@input="$emit('update:modelValue', $event)" @update:modelValue="$emit('update:modelValue', $event)"
:id="id" :id="id"
:aria-describedby="$parent.id + '__BV_description_'" :aria-describedby="$parent.id + '__BV_description_'"
switch switch

View file

@ -19,7 +19,7 @@
:drop-placeholder="dropPlaceholder" :drop-placeholder="dropPlaceholder"
:state="state" :state="state"
:browse-text="$t('words.browse')" :browse-text="$t('words.browse')"
@input="onInput" @update:modelValue="onInput"
@blur="$parent.$emit('touch', name)" @blur="$parent.$emit('touch', name)"
@focusout="$parent.$emit('touch', name)" @focusout="$parent.$emit('touch', name)"
/> />

View file

@ -1,7 +1,7 @@
<template> <template>
<BFormTags <BFormTags
:value="modelValue" :modelValue="modelValue"
@input="$emit('update:modelValue', $event)" @update:modelValue="$emit('update:modelValue', $event)"
:id="id" :id="id"
:placeholder="placeholder" :placeholder="placeholder"
:required="required" :required="required"

View file

@ -16,14 +16,14 @@
<BFormInput <BFormInput
id="search-input" id="search-input"
:placeholder="$t('search.for', { items: $t('items.apps', 2) })" :placeholder="$t('search.for', { items: $t('items.apps', 2) })"
:value="search" :modelValue="search"
@input="updateQuery('search', $event)" @update:modelValue="updateQuery('search', $event)"
/> />
<BInputGroupAppend> <BInputGroupAppend>
<BFormSelect <BFormSelect
:value="quality" :modelValue="quality"
:options="qualityOptions" :options="qualityOptions"
@change="updateQuery('quality', $event)" @update:modelValue="updateQuery('quality', $event)"
/> />
</BInputGroupAppend> </BInputGroupAppend>
</BInputGroup> </BInputGroup>
@ -34,9 +34,9 @@
<YIcon iname="filter" /> <YIcon iname="filter" />
</BInputGroupPrepend> </BInputGroupPrepend>
<BFormSelect <BFormSelect
:value="category" :modelValue="category"
:options="categories" :options="categories"
@change="updateQuery('category', $event)" @update:modelValue="updateQuery('category', $event)"
/> />
<BInputGroupAppend> <BInputGroupAppend>
<BButton <BButton
@ -63,9 +63,9 @@
/> />
<BFormSelect <BFormSelect
id="subtags-select" id="subtags-select"
:value="subtag" :modelValue="subtag"
:options="subtags" :options="subtags"
@change="updateQuery('subtag', $event)" @update:modelValue="updateQuery('subtag', $event)"
/> />
</BInputGroup> </BInputGroup>
</div> </div>

View file

@ -20,10 +20,9 @@
<template #cell()="data"> <template #cell()="data">
<BFormCheckbox <BFormCheckbox
v-if="data.field.key !== 'uPnP'" v-if="data.field.key !== 'uPnP'"
class="on-off-switch" :modelValue="data.value"
v-model="data.value"
switch switch
@change=" @update:modelValue="
onTablePortToggling( onTablePortToggling(
data.item.port, data.item.port,
protocol, protocol,

View file

@ -168,7 +168,7 @@ export default {
fields: { fields: {
username: { username: {
label: this.$t('user_username'), label: this.$t('user_username'),
value: this.name, modelValue: this.name,
props: { id: 'username', disabled: true }, props: { id: 'username', disabled: true },
}, },