多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
2.8 KiB

2 months ago
<script setup lang="ts">
2 months ago
import FeedRecents from './Recents/index.vue'
import FeedChangelog from './Changelog/index.vue'
2 months ago
import FeedYoutube from './Youtube/index.vue'
import FeedTwitter from './Twitter.vue'
// import FeedRoadmap from './Roadmap.vue'
2 months ago
const { activeTab } = useProductFeed()
2 months ago
const { $e } = useNuxtApp()
2 months ago
const tabs: Array<{
key: string
icon: keyof typeof iconMap
title: string
container: any
}> = [
2 months ago
{
key: 'recents',
2 months ago
icon: 'ncClock',
2 months ago
title: 'Recents',
container: FeedRecents,
},
{
key: 'cloud',
icon: 'ncCloud',
title: 'Cloud Changelog',
container: FeedChangelog,
},
{
key: 'github',
2 months ago
icon: 'ncList',
2 months ago
title: 'Changelog',
2 months ago
container: FeedChangelog,
2 months ago
},
/* {
2 months ago
key: 'roadmap',
icon: 'ncMapPin',
title: 'Roadmap',
container: FeedRoadmap,
}, */
2 months ago
{
key: 'youtube',
icon: 'ncYoutube',
title: 'Youtube',
container: FeedYoutube,
},
{
key: 'twitter',
icon: 'ncTwitter',
title: 'Twitter',
container: FeedTwitter,
},
2 months ago
]
2 months ago
const router = useRouter()
watch(activeTab, (val) => {
$e(`c:nocodb:feed:${val}`)
router.push({ query: { tab: val } })
})
onMounted(() => {
const tab = router.currentRoute.value.query.tab as string
if (tab && tabs.some((t) => t.key === tab)) {
activeTab.value = tab
}
})
2 months ago
</script>
<template>
<FeedHeader />
2 months ago
<div class="flex flex-col h-full">
<NcTabs v-model:activeKey="activeTab" centered>
<a-tab-pane v-for="tab in tabs" :key="tab.key" class="bg-gray-50 !h-full">
<template #tab>
<div class="flex gap-2 items-center">
2 months ago
<GeneralIcon
:class="{
'text-brand-500': activeTab === tab.key,
'text-gray-600': activeTab !== tab.key,
}"
:icon="tab.icon as any"
/>
<span
:class="{
'text-brand-500 font-medium': activeTab === tab.key,
'text-gray-700': activeTab !== tab.key,
}"
class="text-sm"
>{{ tab.title }}
</span>
</div>
</template>
<div class="relative">
<FeedSocial
:class="{
'normal-left': ['recents', 'youtube', 'cloud'].includes(tab.key),
'changelog-left': tab.key === 'github',
'changelog-twitter': tab.key === 'twitter',
}"
class="absolute social-card"
/>
<component :is="tab.container" :type="tab.key" />
</div>
2 months ago
</a-tab-pane>
</NcTabs>
</div>
2 months ago
</template>
<style scoped lang="scss">
.social-card {
top: 24px;
}
.normal-left {
@apply xl:left-[calc(50%+350px)] left-[calc(50%+300px)];
}
.changelog-left {
@apply xl:left-[calc(50%+350px)] left-[calc(50%+300px)];
}
.changelog-twitter {
left: calc(50% + 350px);
}
</style>