Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/runtime-dom/src/directives/vShow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export interface VShowElement extends HTMLElement {
[vShowHidden]: boolean
}

export const vShow: ObjectDirective<VShowElement> & { name?: 'show' } = {
export const vShow: ObjectDirective<VShowElement> & { name: 'show' } = {
// used for prop mismatch check during hydration
name: 'show',
beforeMount(el, { value }, { transition }) {
el[vShowOriginalDisplay] =
el.style.display === 'none' ? '' : el.style.display
Expand Down Expand Up @@ -45,10 +47,6 @@ export const vShow: ObjectDirective<VShowElement> & { 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
Expand Down
Loading