feat(W4): 站点path全链路-portalUrlOf/previewPortalUrl纯函数,站点列/向导地址预览/预览frame sitePath,store携带path,mock嵌套路由,T-W4-16..18 绿51/51

This commit is contained in:
chenxing
2026-09-08 15:14:10 +08:00
parent 7b99ec398d
commit dedd4a6a3a
16 changed files with 297 additions and 37 deletions
+5 -5
View File
@@ -8,21 +8,21 @@ import { FormModelValue } from "@/utils/themeParamForm";
* no-store),参数变更由父级 debounce 后更新 src。内容源站点不存在时提示。
*/
const props = defineProps<{
/** 预览内容源站点编码(取该站栏目/文章/轮播渲染) */
siteCode?: string;
/** 预览内容源站点门户路径(W4:sitePath 语义,取该站栏目/文章/轮播渲染) */
sitePath?: string;
theme?: string;
themeParams?: FormModelValue;
}>();
const src = computed(() => {
if (!props.siteCode || !props.theme) return "";
return themePreviewUrl(props.siteCode, props.theme, props.themeParams || {});
if (!props.sitePath || !props.theme) return "";
return themePreviewUrl(props.sitePath, props.theme, props.themeParams || {});
});
</script>
<template>
<div class="theme-preview">
<template v-if="!siteCode || !theme">
<template v-if="!sitePath || !theme">
<div class="preview-empty">
无可用内容源站点 —— 预览需要借用一个已有站点的内容
<p class="hint">请先创建/启用一个站点(或初始化演示数据)后再预览</p>