watch callback has something side effect when calling `createApp` in the callback
Vue version
3.2.39
Link to minimal reproduction
Steps to reproduce
- Open the demo@vue3.2.39
- After clicking it, log
1,1,2,2
will appear
What is expected?
- open the demo@vue3.2.37
- After clicking it, log
1,2,1,2
will appear
What is actually happening?
Log: 1, 1, 2, 2
System Info
No response
Any additional comments?
No response
Workaround:
watch(
() => isActive.value,
(v) => {
if (v) {
loadData()
}
},
// use post
{ flush: 'post' }
)
Workaround:
watch( () => isActive.value, (v) => { if (v) { loadData() } }, // use post { flush: 'post' } )
this workaround seems no work,vue will flush pre end post job when render a new component in vue 3.2.39