Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[新功能需求] Tabs组件希望可以提供标签标题的slot定制 #739

Open
mirari opened this issue Nov 26, 2024 · 0 comments
Open
Labels
feature: need confirm 待确认的新特性

Comments

@mirari
Copy link

mirari commented Nov 26, 2024

这个功能解决了什么问题?

允许使用tabs组件时进行更丰富的内容展现,不局限于纯字符串。

如果将tab标题添加slot支持,可以满足以下场景:

  • 被选中的标签或者指定某个标签改变颜色或字体大小
  • 为每个标签标题添加不同的图标或使用图片等展示方式
  • 允许外部样式适配到标签标题,比如不同主题配色下的标题颜色
  • 添加wot以外展示形式的角标

文字加粗等默认行为产生的样式可以继承到slot中。

你期望的 API 是什么样子的?

<wd-tabs v-model="tab">
  <block v-for="item in 4" :key="item">
    <wd-tab>
      <template #default>
         <view class="content">内容{{ item}}</view>
      </template>
      <template #title="{title}">
        <view class="flex items-center">
          <view class="i-carbon-flag" />
          <view class="color-title">标签{{item}}</view>
        </view>
      </template>
    </wd-tab>
  </block>
</wd-tabs>
@mirari mirari added the feature: need confirm 待确认的新特性 label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: need confirm 待确认的新特性
Projects
None yet
Development

No branches or pull requests

1 participant