I am new to vue3 and have some confusion about shallowReactive.
only root-level properties are reactive for a shallow reactive object.
But when I click the add button, the value of count2 will still change:
<script setup>
import { shallowReactive } from 'vue'
const test = shallowReactive({
count1: 0,
nested: {
count2: 0
}
})
const add = () => {
test.count1++
test.nested.count2++
}
</script>
<template>
<button @click="add">+</button>
<div>{{ test.count1 }}</div>
<div>{{ test.nested.count2 }}</div>
</template>