From acd3fa930405244393311cd4e0e3a0eb5a3a2eaa Mon Sep 17 00:00:00 2001 From: tiny-craft <137850705+tiny-craft@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:25:49 +0800 Subject: [PATCH] style: update the tab style --- .../src/components/content/ContentLogPane.vue | 7 +- .../components/content/ContentValueTab.vue | 64 ++++++++++++++----- 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/content/ContentLogPane.vue b/frontend/src/components/content/ContentLogPane.vue index a7bce08..d4cd9b9 100644 --- a/frontend/src/components/content/ContentLogPane.vue +++ b/frontend/src/components/content/ContentLogPane.vue @@ -7,6 +7,9 @@ import { map, uniqBy } from 'lodash' import { useI18n } from 'vue-i18n' import Delete from '@/components/icons/Delete.vue' import dayjs from 'dayjs' +import { useThemeVars } from 'naive-ui' + +const themeVars = useThemeVars() const connectionStore = useConnectionStore() const i18n = useI18n() @@ -72,7 +75,8 @@ defineExpose({ :bordered="false" :title="$t('log.launch_log')" class="content-container flex-box-v" - content-style="display: flex;flex-direction: column; overflow: hidden;"> + content-style="display: flex;flex-direction: column; overflow: hidden; backgroundColor: gray" + :theme-overrides="{ borderRadius: '0px' }"> diff --git a/frontend/src/components/content/ContentValueTab.vue b/frontend/src/components/content/ContentValueTab.vue index 38b780c..315185d 100644 --- a/frontend/src/components/content/ContentValueTab.vue +++ b/frontend/src/components/content/ContentValueTab.vue @@ -25,20 +25,20 @@ const activeTabStyle = computed(() => { const { name } = tabStore.currentTab const { markColor = '' } = connectionStore.serverProfile[name] || {} return { - backgroundColor: themeVars.value.bodyColor, borderTopWidth: markColor ? '3px' : '1px', borderTopColor: markColor || themeVars.value.borderColor, - borderBottomColor: themeVars.value.bodyColor, - borderTopLeftRadius: themeVars.value.borderRadius, - borderTopRightRadius: themeVars.value.borderRadius, } }) -const inactiveTabStyle = computed(() => ({ - borderWidth: '0 0 1px', - // borderBottomColor: themeVars.value.borderColor, - borderTopLeftRadius: themeVars.value.borderRadius, - borderTopRightRadius: themeVars.value.borderRadius, -})) + +const tabClass = (idx) => { + if (tabStore.activatedIndex === idx) { + return ['value-tab', 'value-tab-active'] + } else if (tabStore.activatedIndex - 1 === idx) { + return ['value-tab', 'value-tab-inactive'] + } else { + return ['value-tab', 'value-tab-inactive', 'value-tab-inactive2'] + } +} const tab = computed(() => map(tabStore.tabs, (item) => ({ @@ -52,6 +52,7 @@ const tab = computed(() => @@ -89,4 +89,38 @@ const tab = computed(() => - +