Skip to content

Instantly share code, notes, and snippets.

@guillaumeduhan
Created June 17, 2021 17:00
Show Gist options
  • Save guillaumeduhan/26505ec49c571806afe122e7e7faf39d to your computer and use it in GitHub Desktop.
Save guillaumeduhan/26505ec49c571806afe122e7e7faf39d to your computer and use it in GitHub Desktop.
Vue 3: declare a reactive property
<template>
<div>
<input v-model.lazy="name" />
<p>{{ name }}</p>
</div>
</template>
<script>
import { reactive, toRefs } from "vue";
export default {
setup () {
const data = reactive({
name: 'Guillaume'
})
return {
...toRefs(data)
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment