polish: warn deprecated beforeDestroy/destroyed lifecycle hooks (#1999)
This commit is contained in:
parent
fcf9b2cf19
commit
c65d6def84
@ -316,7 +316,11 @@ interface LegacyOptions<
|
||||
updated?(): void
|
||||
activated?(): void
|
||||
deactivated?(): void
|
||||
/** @deprecated use `beforeUnmount` instead */
|
||||
beforeDestroy?(): void
|
||||
beforeUnmount?(): void
|
||||
/** @deprecated use `unmounted` instead */
|
||||
destroyed?(): void
|
||||
unmounted?(): void
|
||||
renderTracked?: DebuggerHook
|
||||
renderTriggered?: DebuggerHook
|
||||
@ -393,7 +397,9 @@ export function applyOptions(
|
||||
updated,
|
||||
activated,
|
||||
deactivated,
|
||||
beforeDestroy,
|
||||
beforeUnmount,
|
||||
destroyed,
|
||||
unmounted,
|
||||
render,
|
||||
renderTracked,
|
||||
@ -631,9 +637,19 @@ export function applyOptions(
|
||||
if (renderTriggered) {
|
||||
onRenderTriggered(renderTriggered.bind(publicThis))
|
||||
}
|
||||
if (__DEV__ && beforeDestroy) {
|
||||
warn(
|
||||
`\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
|
||||
)
|
||||
}
|
||||
if (beforeUnmount) {
|
||||
onBeforeUnmount(beforeUnmount.bind(publicThis))
|
||||
}
|
||||
if (__DEV__ && destroyed) {
|
||||
warn(
|
||||
`\`destroyed\` has been renamed to \`unmounted\`.`
|
||||
)
|
||||
}
|
||||
if (unmounted) {
|
||||
onUnmounted(unmounted.bind(publicThis))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user