You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: document/components/docs/en-US/tab-bar.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ The following demo code is [here](https://github.com/didi/cube-ui/tree/master/ex
14
14
15
15
- Basic usage
16
16
17
-
You can initialize `cube-tab-bar` by passing in the data structure of `tabs` as follows. You must use the `v-model` directive to select the corresponding tab. The value of the v-model argument must correspond to the labelattribute of a tab in `cube-tab-bar`. The icon attribute is used as a class selector, which is generally used with icon-font class. It will dispatch `click` and `change` event at the proper time. The parameter is the label value corresponding to each selected tab.
17
+
You can initialize `cube-tab-bar` by passing in the data structure of `tabs` as follows. You must use the `v-model` directive to select the corresponding tab. The value of the v-model argument must correspond to the `label`(after 1.12.5, use `value`) attribute of a tab in `cube-tab-bar`. The icon attribute is used as a class selector, which is generally used with icon-font class. It will dispatch `click` and `change` event at the proper time. The parameter is the `label`(after 1.12.5, is `value`) value corresponding to each selected tab.
18
18
19
19
```html
20
20
<template>
@@ -108,7 +108,7 @@ The following demo code is [here](https://github.com/didi/cube-ui/tree/master/ex
108
108
109
109
### CubeTabBar & CubeTabPanels
110
110
111
-
Usually, our requirement is to display different panel as tabs are switched, so we need to use the `cube-tab-panels` component. `cube-tab-panels` must be nested with `cube-tab-panel`. The label values passed to `cube-tab` and `cube-tab-panel` must be the same, because it is necessary to create the relationship between tab with panel. They are linked by the same `v-model`.To see the effect, click on the `tab-basic` demo on the right.
111
+
Usually, our requirement is to display different panel as tabs are switched, so we need to use the `cube-tab-panels` component. `cube-tab-panels` must be nested with `cube-tab-panel`. The `label`(after 1.12.5, use `value`) values passed to `cube-tab` and `cube-tab-panel` must be the same, because it is necessary to create the relationship between tab with panel. They are linked by the same `v-model`.To see the effect, click on the `tab-basic` demo on the right.
112
112
113
113
```html
114
114
<template>
@@ -158,7 +158,7 @@ In fact, `cube-tab-bar` can be combined with many other cube-ui's components (su
| value | Use v-model to select the corresponding tab when initializing. | String/Number | - | - |
161
-
| data | For data rendered with `cube-tab-bar`, when using the built-in default slot, this parameter must be passed. Each item of the array is an Object type, including `label`and `icon`. If a custom slot is used, this value may not be passed | Array |[{label: 1, icon: 'cubeic-like'}, {label: 2, icon: 'cubeic-like'}]|[]|
161
+
| data | For data rendered with `cube-tab-bar`, when using the built-in default slot, this parameter must be passed. Each item of the array is an Object type, including `label`, `icon`and `value`<sup>1.12.5+</sup>. If a custom slot is used, this value may not be passed | Array |[{label: 1, value: 1, icon: 'cubeic-like'}, {label: 2, value: 2, icon: 'cubeic-like'}]|[]|
162
162
| showSlider | Whether to turn on the underscore follow effect | Boolean | true/false | false |
163
163
| inline | Whether text and icons are displayed on one line | Boolean | true/false | false |
164
164
| useTransition | Whether to use transition | Boolean | true/false | true |
@@ -167,20 +167,22 @@ In fact, `cube-tab-bar` can be combined with many other cube-ui's components (su
| value | Use v-model to display the corresponding panels at initialization | String/Number | - | - |
177
-
| data | For data rendered with `cube-tab-panels`, when using the built-in default slot, this parameter must be passed. Each item of the array is an Object type, including `label`. If a custom slot is used, this value may not be passed | Array |[{label: 1}, {label: 2}]|[]|
178
+
| data | For data rendered with `cube-tab-panels`, when using the built-in default slot, this parameter must be passed. Each item of the array is an Object type, including `label` and `value`<sup>1.12.5+</sup>. If a custom slot is used, this value may not be passed | Array |[{label: 1, value: 1}, {label: 2, value: 2}]|[]|
0 commit comments