diff --git a/examples/docs/en-US/tabs.md b/examples/docs/en-US/tabs.md index c5a2e9433..1eae67e52 100644 --- a/examples/docs/en-US/tabs.md +++ b/examples/docs/en-US/tabs.md @@ -376,6 +376,7 @@ Only card type Tabs support addable & closeable. | editable | whether Tab is addable and closable | boolean | — | false | | value | name of the selected tab | string | — | name of first tab | | tab-position | position of tabs | string | top/right/bottom/left | top | +| stretch | whether width of tab automatically fits its container | boolean | - | false | | before-leave | hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented | function | — | — | ### Tabs Events diff --git a/examples/docs/es/tabs.md b/examples/docs/es/tabs.md index aa8687f74..ea2adfd6c 100644 --- a/examples/docs/es/tabs.md +++ b/examples/docs/es/tabs.md @@ -376,6 +376,7 @@ Solo las pestañas de tipo tarjeta soportan adición y cierre. | editable | si la Pestaña es añadible y cerrable | boolean | — | false | | value | nombre de la pestaña seleccionada | string | — | nombre de la primer pestaña | | tab-position | posición de tabulación | string | top/right/bottom/left | top | +| stretch | whether width of tab automatically fits its container | boolean | - | false | | before-leave | función `hook` antes de cambiar de pestaña. Si se devuelve `false` o se devuelve una `Promise` y luego se rechaza, se evitará el cambio. | function | — | — | ### Eventos de Pestañas diff --git a/examples/docs/zh-CN/tabs.md b/examples/docs/zh-CN/tabs.md index e84aeaf06..4ef3ccc61 100644 --- a/examples/docs/zh-CN/tabs.md +++ b/examples/docs/zh-CN/tabs.md @@ -374,6 +374,7 @@ | editable | 标签是否同时可增加和关闭 | boolean | — | false | | value | 绑定值,选中选项卡的 name | string | — | 第一个选项卡的 name | | tab-position | 选项卡所在位置 | string | top/right/bottom/left | top | +| stretch | 标签的宽度是否自撑开 | boolean | - | false | | before-leave | 切换标签之前的钩子,若返回 false 或者返回 Promise 且被 reject,则阻止切换。 | function | — | — | ### Tabs Events diff --git a/packages/tabs/src/tab-nav.vue b/packages/tabs/src/tab-nav.vue index 28b07588c..203d20c48 100644 --- a/packages/tabs/src/tab-nav.vue +++ b/packages/tabs/src/tab-nav.vue @@ -28,7 +28,8 @@ type: Function, default: noop }, - type: String + type: String, + stretch: Boolean }, data() { @@ -187,6 +188,7 @@ type, panes, editable, + stretch, onTabClick, onTabRemove, navStyle, @@ -246,7 +248,13 @@