云
昨天 c2e8526f8f857be5e3a8c6f2b39c5efd424de33e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import type { QualityComponentDefinition } from '../core/types';
 
import { QUALITY_ICONS } from '../core/icons';
import { QUALITY_CATEGORY } from '../core/types';
 
export const spacerDefinition: QualityComponentDefinition = {
  type: 'Spacer',
  name: 'spacer',
  label: '间距',
  category: QUALITY_CATEGORY.BASIC,
  icon: QUALITY_ICONS.spacer,
  aiHint: '纯空白间距,只用来撑开版面,不承载任何内容。',
  defaults: { height: 16 },
  propertySchema: [{ key: 'height', label: '高度(px)', type: 'number', defaultValue: 16 }],
  dataSchema: [],
  buildContent: (properties) => ({
    tagName: 'div',
    style: { height: `${Number(properties.height ?? 16)}px` },
  }),
};