-
-
Save ycmjason/4a97281e1c3dc818af591953a5210aa1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ref, computed, watch } from '@vue/runtime-core' | |
const counter = ref(0) | |
const squared = computed(() => counter.value ** 2) | |
setInterval(() => counter.value += 1, 1000) | |
watch(() => { | |
console.log(`counter: ${counter.value}`, `counter²: ${squared.value}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment