From dfb6df018a276b0cc854d76539abd292f2ac872e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Sun, 2 Apr 2023 23:42:04 +0900 Subject: [PATCH] ci(#10336): add static option to `PageHeader.tabs` --- .../src/components/global/MkPageHeader.stories.impl.ts | 1 + .../frontend/src/components/global/MkPageHeader.tabs.vue | 7 ++++++- packages/frontend/src/components/global/MkPageHeader.vue | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/global/MkPageHeader.stories.impl.ts b/packages/frontend/src/components/global/MkPageHeader.stories.impl.ts index b23a1e3a0..f164e0957 100644 --- a/packages/frontend/src/components/global/MkPageHeader.stories.impl.ts +++ b/packages/frontend/src/components/global/MkPageHeader.stories.impl.ts @@ -23,6 +23,7 @@ export const Empty = { }; }, args: { + static: true, tabs: [], }, parameters: { diff --git a/packages/frontend/src/components/global/MkPageHeader.tabs.vue b/packages/frontend/src/components/global/MkPageHeader.tabs.vue index 9e1da64e6..166f632c6 100644 --- a/packages/frontend/src/components/global/MkPageHeader.tabs.vue +++ b/packages/frontend/src/components/global/MkPageHeader.tabs.vue @@ -52,6 +52,7 @@ import { onMounted, onUnmounted, watch, nextTick, shallowRef } from 'vue'; import { defaultStore } from '@/store'; const props = withDefaults(defineProps<{ + static?: boolean; tabs?: Tab[]; tab?: string; rootEl?: HTMLElement; @@ -127,7 +128,11 @@ async function enter(el: HTMLElement) { entering = false; }); - setTimeout(renderTab, 170); + if (props.static) { + renderTab(); + } else { + setTimeout(renderTab, 170); + } } function afterEnter(el: HTMLElement) { //el.style.width = ''; diff --git a/packages/frontend/src/components/global/MkPageHeader.vue b/packages/frontend/src/components/global/MkPageHeader.vue index 0d229a937..94e1e8dd0 100644 --- a/packages/frontend/src/components/global/MkPageHeader.vue +++ b/packages/frontend/src/components/global/MkPageHeader.vue @@ -19,7 +19,7 @@ - +