官网开发 0810
This commit is contained in:
@@ -72,6 +72,13 @@ const paddingY = computed(() => {
|
||||
return typeof v === 'number' && v >= 0 ? `${v}px` : '';
|
||||
});
|
||||
|
||||
// 区块上下外边距(config.margin_y):单位 px,区块与相邻区块的间隙(露出页面背景);
|
||||
// 未设置或 0 = 紧贴相邻区块(默认,全宽无缝拼接设计)
|
||||
const marginY = computed(() => {
|
||||
const v = props.section.config?.margin_y;
|
||||
return typeof v === 'number' && v > 0 ? `${v}px` : '';
|
||||
});
|
||||
|
||||
// 标题字号(config.title_font_size):桌面端 px,未设置时不下发变量(main.css 的 section h2 规则兜底 36px);
|
||||
// 移动端按桌面值 62.5% 等比缩小(--sec-title-fs-m)
|
||||
const titleFontSize = computed(() => {
|
||||
@@ -89,6 +96,7 @@ const sectionStyleVars = computed<CSSProperties>(() => {
|
||||
'--sec-cw': containerWidth,
|
||||
borderRadius: borderRadius.value,
|
||||
...(paddingY.value ? { '--sec-py': paddingY.value } : {}),
|
||||
...(marginY.value ? { marginTop: marginY.value, marginBottom: marginY.value } : {}),
|
||||
...(titleFontSize.value ? { '--sec-title-fs': titleFontSize.value.desktop, '--sec-title-fs-m': titleFontSize.value.mobile } : {})
|
||||
} as CSSProperties;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user