1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00

fix(Space): Text is not defined in SSR ()

This commit is contained in:
qiang 2023-02-07 10:13:30 +08:00 committed by GitHub
parent ff14e7585b
commit c05c31772a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,10 +1,12 @@
import { import {
computed, computed,
Comment,
CSSProperties, CSSProperties,
defineComponent, defineComponent,
ExtractPropTypes, ExtractPropTypes,
Fragment, Fragment,
PropType, PropType,
Text,
type VNode, type VNode,
} from 'vue'; } from 'vue';
import { createNamespace } from '../utils'; import { createNamespace } from '../utils';
@ -47,7 +49,7 @@ function filterEmpty(children: VNode[] = []) {
(c) => (c) =>
!( !(
c && c &&
((typeof Comment !== 'undefined' && c.type === Comment) || (c.type === Comment ||
(c.type === Fragment && c.children?.length === 0) || (c.type === Fragment && c.children?.length === 0) ||
(c.type === Text && (c.children as string).trim() === '')) (c.type === Text && (c.children as string).trim() === ''))
) )