How can I make this call?
<ValidWordList
:items="answer.WordList"
:labelText="answer.WordList.length + ' Words'"
/></template>
I need to select a string from the items array in order to execute this function:
function select(word: string) {
console.log(word)
answer.value = word
}
Below is the component structure:
<template>
<v-select :items="items" return string :label="labelText" ></v-select>
</template>
<script setup lang="ts">
export interface Props {
items?: string[]
labelText: string
}
const props = defineProps({
items: {
type: Array,
default: ''
},
labelText: {
type: String,
default: ' Words'
}
})
</script>
I'm struggling to make it work and have tried using @input, @change, and emitting back, but nothing seems to be effective.