From 076d4303f7b2313f0f9c72be8b53d92ebddfd199 Mon Sep 17 00:00:00 2001 From: baiyaaaaa Date: Tue, 20 Dec 2016 11:48:24 +0800 Subject: [PATCH] add param to label-content render function --- examples/docs/en-US/tabs.md | 2 +- examples/docs/zh-CN/tabs.md | 2 +- packages/tabs/src/tabs.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/docs/en-US/tabs.md b/examples/docs/en-US/tabs.md index 7df2ef9cd..36009b1f7 100644 --- a/examples/docs/en-US/tabs.md +++ b/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' | diff --git a/examples/docs/zh-CN/tabs.md b/examples/docs/zh-CN/tabs.md index caab5af37..e77a31ed7 100644 --- a/examples/docs/zh-CN/tabs.md +++ b/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' | diff --git a/packages/tabs/src/tabs.vue b/packages/tabs/src/tabs.vue index aabef15cf..3eab806f0 100644 --- a/packages/tabs/src/tabs.vue +++ b/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 ]);