diff --git a/packages/runtime-dom/src/directives/vShow.ts b/packages/runtime-dom/src/directives/vShow.ts index 2fa934efe52..393d2de11d3 100644 --- a/packages/runtime-dom/src/directives/vShow.ts +++ b/packages/runtime-dom/src/directives/vShow.ts @@ -9,7 +9,9 @@ export interface VShowElement extends HTMLElement { [vShowHidden]: boolean } -export const vShow: ObjectDirective & { name?: 'show' } = { +export const vShow: ObjectDirective & { name: 'show' } = { + // used for prop mismatch check during hydration + name: 'show', beforeMount(el, { value }, { transition }) { el[vShowOriginalDisplay] = el.style.display === 'none' ? '' : el.style.display @@ -45,10 +47,6 @@ export const vShow: ObjectDirective & { name?: 'show' } = { }, } -if (__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) { - vShow.name = 'show' -} - function setDisplay(el: VShowElement, value: unknown): void { el.style.display = value ? el[vShowOriginalDisplay] : 'none' el[vShowHidden] = !value