【Quasar】【q-select】when you handle map type, use emit-value and map-options props
When map-options is used, the model can contain only the value, and it will be mapped against the options to determine its label. There is a performance penalty involved, so use it only if absolutely necessary. It’s not needed, for example, if the model contains the whole Object (so contains the label prop).
<template>
<div class="q-pa-md" style="max-width: 300px">
<div class="q-gutter-md">
<q-badge color="secondary" multi-line>
Model: "{{ model }}"
</q-badge>
<q-select
filled
v-model="model"
:options="options"
label="Standard"
emit-value
map-options
/>
</div>
</div>
</template>
<script>
import { ref } from 'vue'
export default {
setup () {
return {
model: ref(null),
options: [
{
label: 'Google',
value: 'goog'
},
{
label: 'Facebook',
value: 'fb'
},
{
label: 'Twitter',
value: 'twt'
},
{
label: 'Apple',
value: 'app'
},
{
label: 'Oracle',
value: 'ora',
disable: true
}
]
}
}
}
</script>
Author And Source
この問題について(【Quasar】【q-select】when you handle map type, use emit-value and map-options props), 我々は、より多くの情報をここで見つけました https://qiita.com/island_jima/items/83d9caf6fce3cafb4527著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .