79591437

Date: 2025-04-24 20:53:40
Score: 2
Natty:
Report link

Update for Vue 3 + Composition API

<template>
  <input id="input1" ref="input1" type="checkbox">
</template>

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

const inputRef = useTemplateRef('input1')

onMounted(() => {
  console.log(inputRef.value)
})
</script>

See: https://vuejs.org/guide/essentials/template-refs.html

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: mikesamm