官网开发 0804
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { SectionBlock, SectionConfig } from '~/types/site';
|
||||
import { resolveAssetUrl } from '~/utils/resolveAssetUrl';
|
||||
|
||||
/**
|
||||
* 区块内容多语言解析
|
||||
@@ -16,7 +17,10 @@ export function useSectionContent(section: SectionBlock) {
|
||||
const content = computed(() => (isEn.value ? section.content_en : section.content_zh) || '');
|
||||
const ctaPrimaryText = computed(() => (isEn.value ? section.cta_primary_en : section.cta_primary_zh) || '');
|
||||
const ctaSecondaryText = computed(() => (isEn.value ? section.cta_secondary_en : section.cta_secondary_zh) || '');
|
||||
const mediaUrl = computed(() => (isEn.value ? section.media_url_en : section.media_url_zh) || section.media_url_zh || '');
|
||||
// media_url_zh/_en 以语言后缀结尾,不命中数据层 resolveAssetUrls 的 *_url 匹配,需在此单独解析相对路径
|
||||
const mediaUrl = computed(() =>
|
||||
resolveAssetUrl((isEn.value ? section.media_url_en : section.media_url_zh) || section.media_url_zh || '')
|
||||
);
|
||||
|
||||
const config = computed<SectionConfig>(() => section.config ?? {});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user