JSFiddle - React, Tailwind, and code Playground
by skirtle
HTML
<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
<div id="app"></div>
JavaScript
const { createApp, h, ref } = Vue
createApp({
setup () {
const inputRef = ref(null)
function onClick() {
inputRef.value.focus()
}
return () => h('div', null, [
h('input', { ref: el => inputRef.value = el }),
h('button', { onClick }, ['Focus'])
])
}
}).mount('#app')