Vue 3's reactivity is built on JavaScript Proxies. When you make state reactive, Vue wraps it in a Proxy that intercepts reads and writes, lets it track which effects depend on which properties, and triggers those effects to re-run when the data changes.
The core mechanism: track on read, trigger on write
() {
(target, {
() {
(obj, key);
obj[key];
},
() {
obj[key] = value;
(obj, key);
;
},
});
}
