feat(Tab): add to、url、replace prop (#4422)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user