Skip to content

6 - shallow ref #2876

Open
Open
@geek4ctrl

Description

@geek4ctrl
// your answers
<script setup lang="ts"> import { shallowRef, watch } from "vue" const state = shallowRef({ count: 1 }) // Does NOT trigger watch(state, () => { console.log("State.count Updated") }, { deep: true }) /** * Modify the code so that we can make the watch callback trigger. */ // state.value.count = 2 state.value = { count: 2 } </script>

{{ state.count }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions