ci(#10336): add static option to PageHeader.tabs

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-04-02 23:42:04 +09:00
parent d6b1e5be2f
commit dfb6df018a
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99
3 changed files with 9 additions and 2 deletions

View File

@ -23,6 +23,7 @@ export const Empty = {
}; };
}, },
args: { args: {
static: true,
tabs: [], tabs: [],
}, },
parameters: { parameters: {

View File

@ -52,6 +52,7 @@ import { onMounted, onUnmounted, watch, nextTick, shallowRef } from 'vue';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
static?: boolean;
tabs?: Tab[]; tabs?: Tab[];
tab?: string; tab?: string;
rootEl?: HTMLElement; rootEl?: HTMLElement;
@ -127,8 +128,12 @@ async function enter(el: HTMLElement) {
entering = false; entering = false;
}); });
if (props.static) {
renderTab();
} else {
setTimeout(renderTab, 170); setTimeout(renderTab, 170);
} }
}
function afterEnter(el: HTMLElement) { function afterEnter(el: HTMLElement) {
//el.style.width = ''; //el.style.width = '';
} }

View File

@ -19,7 +19,7 @@
</div> </div>
</div> </div>
</div> </div>
<XTabs v-if="!narrow || hideTitle" :class="$style.tabs" :tab="tab" :tabs="tabs" :root-el="el" @update:tab="key => emit('update:tab', key)" @tab-click="onTabClick"/> <XTabs v-if="!narrow || hideTitle" :class="$style.tabs" :static="static" :tab="tab" :tabs="tabs" :root-el="el" @update:tab="key => emit('update:tab', key)" @tab-click="onTabClick"/>
</template> </template>
<div v-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight"> <div v-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight">
<template v-for="action in actions"> <template v-for="action in actions">
@ -43,6 +43,7 @@ import { injectPageMetadata } from '@/scripts/page-metadata';
import { $i, openAccountMenu as openAccountMenu_ } from '@/account'; import { $i, openAccountMenu as openAccountMenu_ } from '@/account';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
static?: boolean;
tabs?: Tab[]; tabs?: Tab[];
tab?: string; tab?: string;
actions?: { actions?: {