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

feat: 为tabs组件添加showScrollbar属性 #643

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/component/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const tab = ref('例子')
| inactiveColor | 非活动标签文字颜色 | string | - | - | - |
| animated | 是否开启切换标签内容时的转场动画 | boolean | - | false | - |
| duration | 切换动画过渡时间,单位毫秒 | number | - | 300 | - |
| showScrollbar | 当标签可以滑动时是否显示滚动条 | boolean | - | false | $LOWEST_VERSION$ |

## Tab Attributes

Expand Down
8 changes: 7 additions & 1 deletion src/uni_modules/wot-design-uni/components/wd-tabs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export const tabsProps = {
/**
* 切换动画过渡时间,单位毫秒
*/
duration: makeNumberProp(300)
duration: makeNumberProp(300),
/**
* 控制是否出现滚动条
*
* 默认为 false
*/
showScrollbar: makeBooleanProp(false)
}

export type TabsProps = ExtractPropTypes<typeof tabsProps>
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<!--头部导航容器-->
<view class="wd-tabs__nav">
<view class="wd-tabs__nav--wrap">
<scroll-view :scroll-x="slidableNum < items.length" scroll-with-animation :scroll-left="state.scrollLeft">
<scroll-view :showScrollbar="showScrollbar" :scroll-x="slidableNum < items.length" scroll-with-animation :scroll-left="state.scrollLeft">
<view class="wd-tabs__nav-container">
<!--nav列表-->
<view
Expand Down