本练习中的观察者应该在每次“rangeVal”数据属性更改时将“count”数据属性递增 1。
观察者应该叫什么?
<script> const app = Vue.createApp({ data() { return { rangeVal: 70, count: 0 } }, watch: { @(8)() { this.count++ } } }) app.mount('#app') </script>
<script> const app = Vue.createApp({ data() { return { rangeVal: 70, count: 0 } }, watch: { rangeVal() { this.count++ } } }) app.mount('#app') </script>