I'm trying to dynamically set the value of a text field in Vuetify, focus it and selecting its text (in order for the user to be able to quickly reset the field if necessary). The error I get is "select is not a function". This works for normal text inputs, but does not with Vuetify text fields.
<template>
<vContainer>
<vTextField
ref="input"
v-model="input"
/>
<vBtn
@click="test"
>
Select
</vBtn>
</vContainer>
</template>
<script>
export default {
data: () => ({
input: null,
}),
methods: {
test() {
this.input = 'test value';
this.$refs.input.focus();
// this.$refs.input.select(); -> TypeError: this.$refs.input.select is not a function
},
},
};
</script>