@@ -11,16 +11,6 @@ function createLifeCycle(lifeCyclehook: string) {
11
11
} ;
12
12
}
13
13
14
- function createLifeCycles ( lifeCyclehooks : string [ ] , name : string ) {
15
- return ( callback : Function ) => {
16
- const currentVue = getCurrentVue ( ) ;
17
- const vm = ensureCurrentVMInFn ( name ) ;
18
- lifeCyclehooks . forEach ( lifeCyclehook =>
19
- injectHookOption ( currentVue , vm , lifeCyclehook , callback )
20
- ) ;
21
- } ;
22
- }
23
-
24
14
function injectHookOption ( Vue : VueConstructor , vm : ComponentInstance , hook : string , val : Function ) {
25
15
const options = vm . $options as any ;
26
16
const mergeFn = Vue . config . optionMergeStrategies [ hook ] ;
@@ -33,8 +23,7 @@ export const onMounted = createLifeCycle('mounted');
33
23
export const onBeforeUpdate = createLifeCycle ( 'beforeUpdate' ) ;
34
24
export const onUpdated = createLifeCycle ( 'updated' ) ;
35
25
export const onBeforeUnmount = createLifeCycle ( 'beforeDestroy' ) ;
36
- // only one event will be fired between destroyed and deactivated when an unmount occurs
37
- export const onUnmounted = createLifeCycles ( [ 'destroyed' , 'deactivated' ] , genName ( 'unmounted' ) ) ;
26
+ export const onUnmounted = createLifeCycle ( 'destroyed' ) ;
38
27
export const onErrorCaptured = createLifeCycle ( 'errorCaptured' ) ;
39
28
export const onActivated = createLifeCycle ( 'activated' ) ;
40
29
export const onDeactivated = createLifeCycle ( 'deactivated' ) ;
0 commit comments