Skip to content
Level 3 of 3 · shallowRef, shallowReactive, readonly, markRaw and triggerRef

Shallow and readonly

The escape hatches: when Vue tracks only the surface, and how to trigger by hand.
0 / 8
<script setup>const state = shallowRef({ count: 0 }) function add() {  state.value.count++}</script> <template>  <p>{{ state.count }}</p>  <button @click="add">+1</button></template>
Round 1 of 8
Preview

0

The user clicks +1. Does the page update?