fix: treeNode customTitle cannot get selected prop
* Tree组件中,treeNode配置scopedSlots: {title: 'customeTitle' },无法获取title插槽的slot-scope值
需要定制tree的title时,具体的值在treeNode的数据上,但现在无法获取title处的插槽参数。经过查看ant-design-vue源码,发现TreeNode.jsx文件在title处配置错误,希望能尽快修复
* Update TreeNode.jsx
			
			
				pull/2112/head
			
			
		
							parent
							
								
									1112f2f791
								
							
						
					
					
						commit
						32f669bd48
					
				|  | @ -420,7 +420,7 @@ const TreeNode = { | |||
|         vcTree: { prefixCls, showIcon, icon: treeIcon, draggable, loadData }, | ||||
|       } = this; | ||||
|       const disabled = this.isDisabled(); | ||||
|       const title = getComponentFromProp(this, 'title') || defaultTitle; | ||||
|       const title = getComponentFromProp(this, 'title', {}, false); | ||||
|       const wrapClass = `${prefixCls}-node-content-wrapper`; | ||||
| 
 | ||||
|       // Icon - Still show loading icon when loading without showIcon | ||||
|  | @ -439,9 +439,15 @@ const TreeNode = { | |||
|         $icon = this.renderIcon(); | ||||
|       } | ||||
| 
 | ||||
|       // Title | ||||
|       const $title = <span class={`${prefixCls}-title`}>{title}</span>; | ||||
| 
 | ||||
|       const currentTitle = title; | ||||
|       let $title = currentTitle ? ( | ||||
|         <span class={`${prefixCls}-title`}> | ||||
|           {typeof currentTitle === 'function' ? currentTitle({ ...this.$props }, h) : currentTitle} | ||||
|         </span> | ||||
|       ) : ( | ||||
|         <span class={`${prefixCls}-title`}>{defaultTitle}</span> | ||||
|       ); | ||||
|        | ||||
|       return ( | ||||
|         <span | ||||
|           key="selector" | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 cubemoon
						cubemoon