[Doc] new theme

This commit is contained in:
陈嘉涵
2019-05-15 20:53:04 +08:00
parent 3cae4288f2
commit d0f4169c86
130 changed files with 1460 additions and 1147 deletions
+16 -11
View File
@@ -1,15 +1,16 @@
## Tab
# Tab
### Install
``` javascript
import { Tab, Tabs } from 'vant';
Vue.use(Tab).use(Tabs);
```
### Usage
## Usage
#### Basic Usage
### Basic Usage
The first tab is actived by default, you can set `v-model` to active specified tab.
@@ -31,7 +32,7 @@ export default {
}
```
#### Swipe Tabs
### Swipe Tabs
By default more than 4 tabs, you can scroll through the tabs. You can set `swipe-threshold` attribute to customize threshold number.
@@ -43,7 +44,7 @@ By default more than 4 tabs, you can scroll through the tabs. You can set `swipe
</van-tabs>
```
#### Disabled Tab
### Disabled Tab
You can set `disabled` attribute on the corresponding `van-tab`.
@@ -65,7 +66,7 @@ export default {
};
```
#### Card Style
### Card Style
Tabs styled as cards.
@@ -77,7 +78,7 @@ Tabs styled as cards.
</van-tabs>
```
#### Click Event
### Click Event
```html
<van-tabs @click="onClick">
@@ -97,7 +98,8 @@ export default {
};
```
#### Sticky
### Sticky
In sticky mode, the tab will be fixed to top when scroll to top
```html
@@ -108,7 +110,8 @@ In sticky mode, the tab will be fixed to top when scroll to top
</van-tabs>
```
#### Custom title
### Custom title
Use title slot to custom tab title
```html
@@ -122,7 +125,7 @@ Use title slot to custom tab title
</van-tabs>
```
#### Switch Animation
### Switch Animation
Use `animated` props to change tabs with animation
@@ -134,7 +137,7 @@ Use `animated` props to change tabs with animation
</van-tabs>
```
#### Swipeable
### Swipeable
In swipeable mode, you can switch tabs with swipe gestrue in the content
@@ -146,6 +149,8 @@ In swipeable mode, you can switch tabs with swipe gestrue in the content
</van-tabs>
```
## API
### Tabs Props
| Attribute | Description | Type | Default |
+15 -12
View File
@@ -1,15 +1,16 @@
## Tab 标签页
# Tab 标签页
### 引入
### 使用指南
``` javascript
import { Tab, Tabs } from 'vant';
Vue.use(Tab).use(Tabs);
```
### 代码演示
## 代码演示
#### 基础用法
### 基础用法
默认情况下启用第一个标签,可以通过`v-model`绑定当前激活的标签索引
@@ -32,7 +33,7 @@ export default {
}
```
#### 横向滚动
### 横向滚动
多于 4 个标签时,Tab 可以横向滚动
@@ -44,7 +45,7 @@ export default {
</van-tabs>
```
#### 禁用标签
### 禁用标签
设置`disabled`属性即可禁用标签。如果需要监听禁用标签的点击事件,可以在`van-tabs`上监听`disabled`事件
@@ -66,7 +67,7 @@ export default {
};
```
#### 样式风格
### 样式风格
`Tab`支持两种样式风格:`line`和`card`,默认为`line`样式,可以通过`type`属性修改样式风格
@@ -78,7 +79,7 @@ export default {
</van-tabs>
```
#### 点击事件
### 点击事件
可以在`van-tabs`上绑定`click`事件,事件传参为标签对应的索引和标题
@@ -99,7 +100,7 @@ export default {
};
```
#### 粘性布局
### 粘性布局
通过`sticky`属性可以开启粘性布局,粘性布局下,当 Tab 滚动到顶部时会自动吸顶
@@ -111,7 +112,7 @@ export default {
</van-tabs>
```
#### 自定义标签
### 自定义标签
通过 title 插槽可以自定义标签内容
@@ -126,7 +127,7 @@ export default {
</van-tabs>
```
#### 切换动画
### 切换动画
通过`animated`属性可以开启切换标签内容时的转场动画
@@ -138,7 +139,7 @@ export default {
</van-tabs>
```
#### 滑动切换
### 滑动切换
通过`swipeable`属性可以开启滑动切换标签页
@@ -150,6 +151,8 @@ export default {
</van-tabs>
```
## API
### Tabs Props
| 参数 | 说明 | 类型 | 默认值 | 版本 |