From e70ee5ed7a33799df27a4c90c466574ce3700262 Mon Sep 17 00:00:00 2001 From: ahqrt <1217223113@qq.com> Date: Sun, 3 Apr 2022 15:09:40 +0800 Subject: [PATCH] perf(ui/spaces): add class --- packages/varlet-ui/src/space/Space.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/varlet-ui/src/space/Space.tsx b/packages/varlet-ui/src/space/Space.tsx index 8e469603d70..050ca8e4800 100644 --- a/packages/varlet-ui/src/space/Space.tsx +++ b/packages/varlet-ui/src/space/Space.tsx @@ -5,6 +5,9 @@ import { toPxNum } from '../utils/elements' import { isArray } from '../utils/shared' import '../styles/common.less' import './space.less' +import { call, createNamespace } from '../utils/components' + +const { n, classes } = createNamespace('space') const internalSizes: Record = { mini: [4, 4], @@ -27,7 +30,7 @@ export default defineComponent({ return () => { const { inline, justify, align, wrap, direction, size } = props - let children: VNodeChild[] = slots.default?.() ?? [] + let children: VNodeChild[] = call(slots.default) ?? [] const isInternalSize = internalSizeValidator(size) const [y, x] = getSize(size, isInternalSize) @@ -85,7 +88,7 @@ export default defineComponent({ return (