Skip to content

How to display modified text from data member in :items object array for item-title in v-select dropdown list? #19230

Closed Answered by mayphyuoo
mayphyuoo asked this question in Q&A
Discussion options

You must be logged in to vote

This is what i have come up with.

logic is in convertToReadableText function

<v-select 
    label="Select a permission to copy"
    variant="underlined"
    no-data-text="No permission to choose from"
    :items="permissionsToCopy"
    v-model="selectedPermissionToCopy"
    return-object
>
    <template v-slot:selection="{item, props}">
        <v-list-item v-bind="props" style="padding: 0;" :title="convertToReadableText(item.value)"></v-list-item>
    </template>
    <template v-slot:item="{item, props}">
        <v-list-item v-bind="props" :title="convertToReadableText(item.value)"></v-list-item>
    </template>
</v-select>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mayphyuoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant