From 14b98685f515a8ce6dc889f741e2c0a58a6465a0 Mon Sep 17 00:00:00 2001 From: gene9831 Date: Fri, 14 Feb 2025 11:39:46 +0800 Subject: [PATCH] ui fix --- .../src/components/CanvasViewerSwitcher.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/canvas/container/src/components/CanvasViewerSwitcher.vue b/packages/canvas/container/src/components/CanvasViewerSwitcher.vue index e9af73915..ec6fa1385 100644 --- a/packages/canvas/container/src/components/CanvasViewerSwitcher.vue +++ b/packages/canvas/container/src/components/CanvasViewerSwitcher.vue @@ -32,7 +32,8 @@ :key="option.id" @click="handleSwitchPreview(option.id)" > - {{ option.label }} + + {{ option.label }} @@ -100,8 +101,12 @@ export default { const pageId = state.usedHoverState.element.getAttribute('data-te-page-id') const children = await usePage().getPageChildren(pageId) - state.previewOptions = [{ id: pageId, label: '路由子页面占位符' }].concat( - children.map(({ id, route, routePath }) => ({ id: String(id), label: routePath || route })) + state.previewOptions = [{ id: pageId, label: '路由子页面占位符', icon: 'box' }].concat( + children.map(({ id, name }) => ({ + id: String(id), + label: name, + icon: 'text-page-common' + })) ) } @@ -183,15 +188,18 @@ export default { width: 200px; .option { font-size: 12px; - line-height: 24px; + min-height: 24px; cursor: pointer; display: flex; align-items: center; - height: 24px; + gap: 4px; padding: 0 12px; &:hover { background-color: var(--te-common-bg-container); } + svg { + flex-shrink: 0; + } } .title { font-size: 14px;