[Improvement] Tab animation fluency && position (#379)

This commit is contained in:
neverland
2017-12-05 20:23:34 +08:00
committed by GitHub
parent 2327e75516
commit 5a17bc520a
12 changed files with 199 additions and 393 deletions
+3 -2
View File
@@ -2,7 +2,7 @@
<demo-section>
<demo-block :title="$t('basicUsage')">
<van-tabs :active="active">
<van-tab :title="$t('tab') + index" v-for="index in 4" :key="index">
<van-tab :title="$t('tab') + index" v-for="index in tabs" :key="index">
{{ $t('content') }} {{ index }}
</van-tab>
</van-tabs>
@@ -64,7 +64,8 @@ export default {
data() {
return {
active: 2
active: 2,
tabs: [1, 2, 3, 4]
};
},
+1 -1
View File
@@ -106,7 +106,7 @@ export default {
|-----------|-----------|-----------|-------------|-------------|
| type | There are two style tabs, set this attribute to change tab style | `String` | `line` | `card` |
| active | Index of active tab | `String` `Number` | `0` | - |
| duration | Toggle tab's animation time | `Number` | `0.3` | - | - |
| duration | Toggle tab's animation time | `Number` | `0.2` | - | - |
| swipeThreshold | Set swipe tabs threshold | `Number` | `4` | - | - |
### Tab API
+1 -1
View File
@@ -106,7 +106,7 @@ export default {
|-----------|-----------|-----------|-------------|-------------|
| type | Tab 样式类型 | `String` | `line` | `card` |
| active | 默认激活的 tab | `String` `Number` | `0` | - |
| duration | 切换 tab 的动画时间 | `Number` | `0.3` | - | - |
| duration | 切换 tab 的动画时间 | `Number` | `0.2` | - | - |
| swipeThreshold | 滚动阀值,设置 Tab 超过多少个可滚动 | `Number` | `4` | - | - |
### Tab API