File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import {
32
32
import type { ComponentTypeEmits } from './apiSetupHelpers'
33
33
import { getModelModifiers } from './helpers/useModel'
34
34
import type { ComponentPublicInstance } from './componentPublicInstance'
35
+ import { pauseTracking , resetTracking } from '@vue/reactivity'
35
36
36
37
export type ObjectEmitsOptions = Record <
37
38
string ,
@@ -198,12 +199,14 @@ export function emit(
198
199
}
199
200
200
201
if ( handler ) {
202
+ pauseTracking ( )
201
203
callWithAsyncErrorHandling (
202
204
handler ,
203
205
instance ,
204
206
ErrorCodes . COMPONENT_EVENT_HANDLER ,
205
207
args ,
206
208
)
209
+ resetTracking ( )
207
210
}
208
211
209
212
const onceHandler = props [ handlerName + `Once` ]
@@ -214,12 +217,14 @@ export function emit(
214
217
return
215
218
}
216
219
instance . emitted [ handlerName ] = true
220
+ pauseTracking ( )
217
221
callWithAsyncErrorHandling (
218
222
onceHandler ,
219
223
instance ,
220
224
ErrorCodes . COMPONENT_EVENT_HANDLER ,
221
225
args ,
222
226
)
227
+ resetTracking ( )
223
228
}
224
229
225
230
if ( __COMPAT__ ) {
You can’t perform that action at this time.
0 commit comments