Level 63
Not sure but try this.
ref="input" instead of :ref="input".
<input ref="input" type="number" v-model="data" class="w-12 h-6 rounded-lg">
...
https://vuejs.org/guide/essentials/template-refs.html#accessing-the-refs
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
//template
<input :ref="input" type="number" v-model="data" class="w-12 h-6 rounded-lg">
<button @click="action" type="button">edit</button>
//script
function action () {
console.log(this.$refs.input)
}
Please or to participate in this conversation.