diff --git a/docs/component/tabs.md b/docs/component/tabs.md index 4feef460..d5560d11 100644 --- a/docs/component/tabs.md +++ b/docs/component/tabs.md @@ -127,16 +127,31 @@ const tab = ref('例子') ``` +## 左对齐超出即可滚动 1.3.15 + +`slidable`设置为`always`时,所有的标签会向左侧收缩对齐,超出即可滑动。 + +```html + + + + 内容{{ item }} + + + +``` + + --- -标签页在标签数大于等于 6 个时,可以滑动;当标签数大于等于 10 个时,将会显示导航地图,便于快速定位到某个标签。可以通过设置 `slidable-num` 修改可滑动的数量阈值;设置 `map-num` 修改显示导航地图的阈值。 +标签页在标签数大于等于 6 个时,可以滑动;当标签数大于等于 10 个时,将会显示导航地图,便于快速定位到某个标签。可以通过设置 `slidable-num` 修改可滑动的数量阈值;设置 `map-num` 修改显示导航地图的阈值。`slidable`设置为`always`时,所有的标签会向左侧收缩对齐,超出即可滑动。 ## Tabs Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | | ------------- | -------------------------------- | --------------- | ------ | ------ | -------- | | v-model | 绑定值 | string / number | - | - | - | -| slidable-num | 可滑动的标签数阈值 | number | - | 6 | - | +| slidable-num | 可滑动的标签数阈值,`slidable`设置为`auto`时生效 | number | - | 6 | - | | map-num | 显示导航地图的标签数阈值 | number | - | 10 | - | | sticky | 粘性布局 | boolean | - | false | - | | offset-top | 粘性布局时距离窗口顶部距离 | number | - | 0 | - | @@ -147,6 +162,7 @@ const tab = ref('例子') | inactiveColor | 非活动标签文字颜色 | string | - | - | - | | animated | 是否开启切换标签内容时的转场动画 | boolean | - | false | - | | duration | 切换动画过渡时间,单位毫秒 | number | - | 300 | - | +| slidable | 是否开启滚动导航 | TabsSlidable | `always` | `auto` | $LOWEST_VERSION$ | ## Tab Attributes diff --git a/src/pages/tabs/Index.vue b/src/pages/tabs/Index.vue index 45d7c539..3ffa8cc1 100644 --- a/src/pages/tabs/Index.vue +++ b/src/pages/tabs/Index.vue @@ -74,7 +74,7 @@ - + 内容{{ tab6 + 1 }} @@ -83,6 +83,16 @@ + + + + + 内容{{ tab9 + 1 }} + + + + + @@ -108,6 +118,8 @@ const tab5 = ref(0) const tab6 = ref(0) const tab7 = ref(0) const tab8 = ref(0) +const tab9 = ref(0) + const toast = useToast() function handleClick({ index, name }: any) { console.log('event', { index, name }) diff --git a/src/uni_modules/wot-design-uni/components/wd-tab/wd-tab.vue b/src/uni_modules/wot-design-uni/components/wd-tab/wd-tab.vue index 1f9b45b7..6efda52c 100644 --- a/src/uni_modules/wot-design-uni/components/wd-tab/wd-tab.vue +++ b/src/uni_modules/wot-design-uni/components/wd-tab/wd-tab.vue @@ -1,6 +1,6 @@