182
rated 0 times
[
186]
[
4]
/ answers: 1 / hits: 6574
/ 2 Years ago, thu, may 19, 2022, 12:00:00
I have this watcher (inside <script setup>
:
const form = reactive({
body: '',
image: ''
})
watch(() => form.image, () => {
console.log(form.image)
})
which I want to expand to watch two reactive objects:
watch(() => (form.image, form.body), () => {
console.log(form)
})
but this now only watches form.body
. I've been trying to implement this question's answer, but it doesn't seem to work like my watcher with new and old values. I want the watcher to trigger, when both values are updated.
More From » vue.js