feat(runtime-core): add watchEffect API
BREAKING CHANGE: replae `watch(fn, options?)` with `watchEffect`
The `watch(fn, options?)` signature has been replaced by the new
`watchEffect` API, which has the same usage and behavior. `watch`
now only supports the `watch(source, cb, options?)` signautre.
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
render,
|
||||
serializeInner,
|
||||
nextTick,
|
||||
watch,
|
||||
watchEffect,
|
||||
defineComponent,
|
||||
triggerEvent,
|
||||
TestElement
|
||||
@@ -55,7 +55,7 @@ describe('api: setup context', () => {
|
||||
|
||||
const Child = defineComponent({
|
||||
setup(props: { count: number }) {
|
||||
watch(() => {
|
||||
watchEffect(() => {
|
||||
dummy = props.count
|
||||
})
|
||||
return () => h('div', props.count)
|
||||
@@ -88,7 +88,7 @@ describe('api: setup context', () => {
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
watch(() => {
|
||||
watchEffect(() => {
|
||||
dummy = props.count
|
||||
})
|
||||
return () => h('div', props.count)
|
||||
|
||||
Reference in New Issue
Block a user