[improvement] Tab: optimize transition (#2151)

This commit is contained in:
neverland
2018-11-26 20:58:30 +08:00
committed by GitHub
parent dc11970fa0
commit a1a6bacb3c
6 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ In swipeable mode, you can switch tabs with swipe gestrue in the content
| v-model | Index of active tab | `String` `Number` | `0` |
| color | Tab color | `String` | `#f44` |
| type | Can be set to `line` `card` | `String` | `line` |
| duration | Toggle tab's animation time | `Number` | `0.4` | - |
| duration | Toggle tab's animation time | `Number` | `0.3` | - |
| line-width | Width of tab line (px) | `Number` | Width of active tab |
| swipe-threshold | Set swipe tabs threshold | `Number` | `4` | - |
| sticky | Whether to use sticky mode | `Boolean` | `false` |
+1 -1
View File
@@ -1,7 +1,7 @@
<template>
<div
:class="b('pane', { float: parent.animated })"
v-show="parent.animated || isSelected"
:class="b('pane', { float: parent.animated })"
:style="paneStyle"
>
<slot v-if="inited" />
@@ -219,7 +219,7 @@ exports[`renders demo correctly 1`] = `
</div>
</div>
<div class="van-tabs__content">
<div class="van-tabs__track" style="width:0px;transition-duration:0.4s;transform:translateX(0px);display:none;">
<div class="van-tabs__track" style="width:0px;transition-duration:0.3s;transform:translateX(0px);display:none;">
<div class="van-tab__pane van-tab__pane--float">
<!---->
<!---->
+1 -1
View File
@@ -157,7 +157,7 @@ export default {
| v-model | 当前标签的索引 | `String` `Number` | `0` | 1.0.6 |
| color | 标签颜色 | `String` | `#f44` | 1.2.0 |
| type | 样式类型,可选值为`card` | `String` | `line` | - |
| duration | 动画时间,单位秒 | `Number` | `0.4` | - |
| duration | 动画时间,单位秒 | `Number` | `0.3` | - |
| line-width | 底部条宽度,单位 px | `Number` | - | 1.1.1 |
| swipeable | 是否开启手势滑动切换 | `Boolean` | `false` | 1.0.0 |
| sticky | 是否使用粘性定位布局 | `Boolean` | `false` | - |