refactor(client): refactor header tab handling

This commit is contained in:
syuilo 2022-06-22 16:29:21 +09:00
parent e44cb42de4
commit 85365da69e
13 changed files with 170 additions and 123 deletions

View file

@ -1,7 +1,7 @@
<template>
<div>
<MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs" v-model:tab="tab"/></template>
<MkSpacer :content-max="900">
<div class="ogwlenmc">
<div v-if="tab === 'local'" class="local">
@ -282,13 +282,11 @@ const headerActions = $computed(() => [{
}]);
const headerTabs = $computed(() => [{
active: tab.value === 'local',
key: 'local',
title: i18n.ts.local,
onClick: () => { tab.value = 'local'; },
}, {
active: tab.value === 'remote',
key: 'remote',
title: i18n.ts.remote,
onClick: () => { tab.value = 'remote'; },
}]);
definePageMetadata(computed(() => ({