refactor: ensure ssr branches are included in esm-bundler build
This commit is contained in:
@@ -303,8 +303,9 @@ function callModelHook(
|
||||
fn && fn(el, binding, vnode, prevVNode)
|
||||
}
|
||||
|
||||
// SSR vnode transforms
|
||||
if (__NODE_JS__) {
|
||||
// SSR vnode transforms, only used when user includes client-oriented render
|
||||
// function in SSR
|
||||
export function initVModelForSSR() {
|
||||
vModelText.getSSRProps = ({ value }) => ({ value })
|
||||
|
||||
vModelRadio.getSSRProps = ({ value }, vnode) => {
|
||||
|
||||
@@ -40,14 +40,16 @@ export const vShow: ObjectDirective<VShowElement> = {
|
||||
}
|
||||
}
|
||||
|
||||
if (__NODE_JS__) {
|
||||
function setDisplay(el: VShowElement, value: unknown): void {
|
||||
el.style.display = value ? el._vod : 'none'
|
||||
}
|
||||
|
||||
// SSR vnode transforms, only used when user includes client-oriented render
|
||||
// function in SSR
|
||||
export function initVShowForSSR() {
|
||||
vShow.getSSRProps = ({ value }) => {
|
||||
if (!value) {
|
||||
return { style: { display: 'none' } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setDisplay(el: VShowElement, value: unknown): void {
|
||||
el.style.display = value ? el._vod : 'none'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user