Skip to content

Instantly share code, notes, and snippets.

@bachhm-dev
Created August 30, 2020 15:47
Show Gist options
  • Save bachhm-dev/f05c5e55cd26e76fe0399630c0595687 to your computer and use it in GitHub Desktop.
Save bachhm-dev/f05c5e55cd26e76fe0399630c0595687 to your computer and use it in GitHub Desktop.
<template>
<div>
<input type="text" v-model="name" />
</div>
</template>
<script>
import { ref, watch } from "vue";
export default {
setup() {
const name = ref('');
watch(name, (newVal, oldVal) => {
console.log(`${newVal} ${oldVal}`);
})
return { name };
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment