优化项目结构
This commit is contained in:
@@ -33,16 +33,16 @@ const layoutComponent = computed(() => layoutComponents[props.section.layout] ??
|
||||
|
||||
const isDark = computed(() => props.section.theme === 'dark');
|
||||
|
||||
// 遮罩透明度(decimal 字符串 -> 数值)
|
||||
const overlayOpacity = computed(() => Number(props.section.overlay_opacity) || 0);
|
||||
const showOverlay = computed(() => !!props.section.overlay_enabled && overlayOpacity.value > 0);
|
||||
|
||||
// 背景样式
|
||||
const bgStyle = computed(() => {
|
||||
const { bg_type, bg_value } = props.section;
|
||||
if (bg_type === 'color' && bg_value) {
|
||||
return { backgroundColor: bg_value };
|
||||
}
|
||||
// 渐变:bg_value 为完整 CSS 渐变函数(如 linear-gradient(...));仅在形如渐变函数时应用,避免把普通字符串当背景
|
||||
if (bg_type === 'gradient' && bg_value && bg_value.includes('gradient(')) {
|
||||
return { background: bg_value };
|
||||
}
|
||||
return {};
|
||||
});
|
||||
|
||||
@@ -144,13 +144,6 @@ const bgVideoClass = computed(() =>
|
||||
playsinline
|
||||
/>
|
||||
|
||||
<!-- 遮罩层 -->
|
||||
<div
|
||||
v-if="showOverlay"
|
||||
class="absolute inset-0 bg-black"
|
||||
:style="{ opacity: overlayOpacity }"
|
||||
/>
|
||||
|
||||
<!-- 布局内容 -->
|
||||
<div class="relative z-10">
|
||||
<component :is="layoutComponent" v-if="layoutComponent" :section="section" />
|
||||
|
||||
Reference in New Issue
Block a user