Created
June 13, 2022 09:53
-
-
Save 12cassie34/0d61920ae1804924747fc34dd48ae86c to your computer and use it in GitHub Desktop.
Vue Reactivity
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, watchEffect } from 'vue' | |
const A = ref(1) | |
const B = ref(2) | |
const C = ref() | |
watchEffect(() => { | |
C.value = A.value + B.value | |
}) | |
A.value = 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment