Files
heroui-vue/apps/docs/demos/tabs-custom-styles.vue
T

52 lines
1.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import {
Tabs,
TabsIndicator,
TabsList,
TabsListContainer,
TabsPanel,
TabsTab,
} from "@heroui-vue/components";
const listClassName = [
"rounded-xl border border-accent/10 bg-accent-soft/30 p-1",
"**:data-[slot=tabs-tab]:rounded-lg",
"**:data-[slot=tabs-tab]:bg-transparent",
"**:data-[slot=tabs-tab]:text-muted",
"**:data-[slot=tabs-tab]:opacity-100",
"**:data-[slot=tabs-tab]:transition-colors",
"**:data-[slot=tabs-tab]:data-[hovered=true]:not-data-[selected=true]:bg-accent-soft",
"**:data-[slot=tabs-tab]:data-[hovered=true]:not-data-[selected=true]:text-accent-soft-foreground",
"**:data-[slot=tabs-tab]:data-[pressed=true]:not-data-[selected=true]:bg-accent-soft-hover",
"**:data-[slot=tabs-tab]:data-[focus-visible=true]:ring-2",
"**:data-[slot=tabs-tab]:data-[focus-visible=true]:ring-accent/15",
"**:data-[slot=tabs-tab]:data-[selected=true]:font-medium",
"**:data-[slot=tabs-tab]:data-[selected=true]:text-accent-foreground",
"**:data-[slot=tabs-tab]:shadow-none",
"**:data-[slot=tabs-indicator]:rounded-lg",
"**:data-[slot=tabs-indicator]:bg-accent",
"**:data-[slot=tabs-indicator]:shadow-none",
].join(" ");
</script>
<template>
<Tabs class="w-full max-w-sm">
<TabsListContainer class="rounded-none bg-transparent">
<TabsList aria-label="计费周期" :class="listClassName">
<TabsTab value="monthly">
按月
<TabsIndicator></TabsIndicator>
</TabsTab>
<TabsTab value="yearly">
按年
<TabsIndicator></TabsIndicator>
</TabsTab>
</TabsList>
</TabsListContainer>
<TabsPanel class="pt-3 text-sm text-muted" value="monthly">
按月计费,随时可取消。
</TabsPanel>
<TabsPanel class="pt-3 text-sm text-muted" value="yearly">
年付可节省 20%。
</TabsPanel>
</Tabs>
</template>