[Improvement] Tab animation fluency && position (#379)
This commit is contained in:
@@ -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]
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user