---
# System prepended metadata

title: watchEffect 練習

---

### ==1.watchEffect用法==
```javascript=
<template>
    <div>
        {{ test }}
        <button type="button" @click="test.a.b.c = 666">增加a</button>
    </div>
</template>
<script>
    let test = ref({ a: { b: { c: 123 } } })
    watchEffect(() => { console.log(test.value.a.b)})      
</script>
```