From 5f9ebe8b4502dcd7fa339adc00e9d9c3166df06b Mon Sep 17 00:00:00 2001 From: zkwolf Date: Wed, 21 Aug 2019 15:17:21 +0800 Subject: [PATCH] fix: treeNode dataRef is undefined --- components/tree-select/index.jsx | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/components/tree-select/index.jsx b/components/tree-select/index.jsx index 6a088a06f..0234ad0d0 100644 --- a/components/tree-select/index.jsx +++ b/components/tree-select/index.jsx @@ -134,20 +134,23 @@ const TreeSelect = { const clearIcon = ; const VcTreeSelectProps = { - props: { - switcherIcon: nodeProps => this.renderSwitcherIcon(prefixCls, nodeProps), - inputIcon, - removeIcon, - clearIcon, - ...rest, - getPopupContainer: getPopupContainer || getContextPopupContainer, - dropdownClassName: classNames(dropdownClassName, `${prefixCls}-tree-dropdown`), - prefixCls, - dropdownStyle: { maxHeight: '100vh', overflow: 'auto', ...dropdownStyle }, - treeCheckable: checkable, - notFoundContent: notFoundContent || renderEmpty(h, 'Select'), - __propsSymbol__: Symbol(), - }, + props: Object.assign( + { + switcherIcon: nodeProps => this.renderSwitcherIcon(prefixCls, nodeProps), + inputIcon, + removeIcon, + clearIcon, + ...rest, + getPopupContainer: getPopupContainer || getContextPopupContainer, + dropdownClassName: classNames(dropdownClassName, `${prefixCls}-tree-dropdown`), + prefixCls, + dropdownStyle: { maxHeight: '100vh', overflow: 'auto', ...dropdownStyle }, + treeCheckable: checkable, + notFoundContent: notFoundContent || renderEmpty(h, 'Select'), + __propsSymbol__: Symbol(), + }, + treeData ? { treeData } : {}, + ), class: cls, on: { ...this.$listeners, change: this.onChange }, ref: 'vcTreeSelect',