Эх сурвалжийг харах

add param to label-content render function

baiyaaaaa 8 жил өмнө
parent
commit
076d4303f7

+ 1 - 1
examples/docs/en-US/tabs.md

@@ -142,6 +142,6 @@ Border card tabs.
 | Attribute      | Description          | Type      | Accepted Values       | Default  |
 |---------- |-------- |---------- |-------------  |-------- |
 | label     | title of the tab   | string   | — |    —     |
-| label-content | render function for tab title | Function(h) | - | - |
+| label-content | render function for tab title | Function(h, tab:vueInstance) | - | - |
 | disabled | whether Tab is disabled | boolean | - | false |
 | name      | identifier corresponding to the activeName of Tabs, representing the alias of the tab-pane | string | — | ordinal number of the tab-pane in the sequence, i.e. the first tab-pane is '1' |

+ 1 - 1
examples/docs/zh-CN/tabs.md

@@ -137,6 +137,6 @@
 | 参数       | 说明     | 类型      | 可选值       | 默认值   |
 |---------- |-------- |---------- |-------------  |-------- |
 | label     | 选项卡标题   | string   | — |    —     |
-| label-content | 选项卡的标题的渲染 Function | Function(h) | - | - |
+| label-content | 选项卡的标题的渲染 Function | Function(h, tab:vueInstance) | - | - |
 | disabled | 是否禁用 | boolean | - | false |
 | name      | 与选项卡 activeName 对应的标识符,表示选项卡别名 | string | — | 该选项卡在选项卡列表中的顺序值,如第一个选项卡则为'1' |

+ 1 - 1
packages/tabs/src/tabs.vue

@@ -119,7 +119,7 @@
           refInFor: true,
           on: { click: (ev) => { handleTabClick(tab, ev); } }
         }, [
-          tab.labelContent ? tab.labelContent.call(this._renderProxy, h) : tab.label,
+          tab.labelContent ? tab.labelContent.call(this._renderProxy, h, tab) : tab.label,
           tab.isClosable ? btnClose : null,
           index === 0 ? activeBar : null
         ]);