Skip to content

Instantly share code, notes, and snippets.

@shershen08
Created April 8, 2022 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shershen08/9a0613bac25907256ef22ce2ea614d8e to your computer and use it in GitHub Desktop.
Save shershen08/9a0613bac25907256ef22ce2ea614d8e to your computer and use it in GitHub Desktop.
vueuse error
<script>
import { ref } from 'vue'
import { watchDebounced } from '@vueuse/core'
export default {
setup(){
const input = ref('')
const updated = ref(0)
watchDebounced(input, () => {
updated.value += 1
}, { debounce: 1000 })
return {
input,
updated
}
}
}
</script>
<template>
<div>
<input v-model="input" placeholder="Try to type anything..." type="text">
<note>Delay is set to 1000ms for this demo.</note>
<p>Input: {{ input }}</p>
<p>Times Updated: {{ updated }}</p>
</div>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment