feat(Tab): add to、url、replace prop (#4422)

This commit is contained in:
neverland
2019-09-11 11:15:53 +08:00
committed by GitHub
parent 6069d72df4
commit eb32c6b02e
11 changed files with 25 additions and 15 deletions
+3
View File
@@ -201,6 +201,9 @@ In swipeable mode, you can switch tabs with swipe gestrue in the content
| name | Identifier | *string \| number* | Index of tab | - |
| title | Title | *string* | - | - |
| disabled | Whether to disable tab | *boolean* | `false` | - |
| url | Link | *string* | - | 2.2.1 |
| to | Target route of the link, same as to of vue-router | *string \| object* | - | 2.2.1 |
| replace | If true, the navigation will not leave a history record | *boolean* | `false` | 2.2.1 |
### Tabs Slots
+3
View File
@@ -205,6 +205,9 @@ export default {
| name | 标签名称,作为匹配的标识符 | *string \| number* | 标签的索引值 | 2.0.6 |
| title | 标题 | *string* | - | - |
| disabled | 是否禁用标签 | *boolean* | `false` | - |
| url | 点击后跳转的链接地址 | *string* | - | 2.2.1 |
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | *string \| object* | - | 2.2.1 |
| replace | 跳转时是否替换当前页面历史 | *boolean* | `false` | 2.2.1 |
### Tabs Slots
+2
View File
@@ -1,5 +1,6 @@
import { createNamespace } from '../utils';
import { ChildrenMixin } from '../mixins/relation';
import { routeProps } from '../utils/router';
const [createComponent, bem] = createNamespace('tab');
@@ -7,6 +8,7 @@ export default createComponent({
mixins: [ChildrenMixin('vanTabs')],
props: {
...routeProps,
name: [Number, String],
title: String,
disabled: Boolean