1

in VPlay I added this code:

<template>
    <v-app>
        <v-container>
            <v-select
                v-model="selectedState"
                :items="states"
                item-value="value"
                item-text="text"
                label="State"
                outlined
            ></v-select>
        </v-container>
    </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const selectedState = ref('')
  const states = ref([
    { value: '1', text: 'VIC' },
    { value: '2', text: 'ACT' },
  ])
</script>

The select drop down has the two objects and not the value/text pairs as expected.

I also get a warning: Invalid prop: type check failed for prop "title". Expected String | Number | Boolean, got Object

I am a novice with Vuetify. What am I missing here? What am i doing wrong?

My intent is to get data from supabase via Pinia and create a select element in a form.

1
  • item-text is for vuetify2, -And for vuetify3, it uses item-title. Commented Apr 21 at 3:12

1 Answer 1

2

You are close but instead of

 item-text="text"

you actually need

item-title="text"

also item-value="value" is not necessary. v-select automatically gets value and title. So if your object had title instead of text for example it would work out of the box.

v-select docs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.