Skip to content

Commit 7e16f96

Browse files
committed
chore(compat): update hook event names for vue3 (now vnode events)
1 parent c7d1065 commit 7e16f96

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/constants/events.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { isVue3 } from '../vue'
2+
13
export const EVENT_NAME_ACTIVATE_TAB = 'activate-tab'
24
export const EVENT_NAME_BLUR = 'blur'
35
export const EVENT_NAME_CANCEL = 'cancel'
@@ -54,8 +56,8 @@ export const EVENT_NAME_TOGGLE = 'toggle'
5456
export const EVENT_NAME_UNPAUSED = 'unpaused'
5557
export const EVENT_NAME_UPDATE = 'update'
5658

57-
export const HOOK_EVENT_NAME_BEFORE_DESTROY = 'hook:beforeDestroy'
58-
export const HOOK_EVENT_NAME_DESTROYED = 'hook:destroyed'
59+
export const HOOK_EVENT_NAME_BEFORE_DESTROY = isVue3 ? 'vnodeBeforeUnmount' : 'hook:beforeDestroy'
60+
export const HOOK_EVENT_NAME_DESTROYED = isVue3 ? 'vNodeUnmounted' : 'hook:destroyed'
5961

6062
export const MODEL_EVENT_NAME_PREFIX = 'update:'
6163

0 commit comments

Comments
 (0)