@@ -7,7 +7,7 @@ import Tree, { TreeProps } from './Tree';
77import { calcRangeKeys , getFullKeyList } from './util' ;
88import Icon from '../icon' ;
99import BaseMixin from '../_util/BaseMixin' ;
10- import { initDefaultProps , getOptionProps } from '../_util/props-util' ;
10+ import { initDefaultProps , getOptionProps , getListeners } from '../_util/props-util' ;
1111import { ConfigConsumerProps } from '../config-provider' ;
1212
1313// export type ExpandAction = false | 'click' | 'dblclick'; export interface
@@ -186,10 +186,8 @@ export default {
186186 const getPrefixCls = this . configProvider . getPrefixCls ;
187187 const prefixCls = getPrefixCls ( 'tree' , customizePrefixCls ) ;
188188 const { _expandedKeys : expandedKeys , _selectedKeys : selectedKeys } = this . $data ;
189- warning (
190- ! this . $listeners . doubleclick ,
191- '`doubleclick` is deprecated. please use `dblclick` instead.' ,
192- ) ;
189+ const listeners = getListeners ( this ) ;
190+ warning ( ! listeners . doubleclick , '`doubleclick` is deprecated. please use `dblclick` instead.' ) ;
193191 const treeProps = {
194192 props : {
195193 icon : getIcon ,
@@ -201,7 +199,7 @@ export default {
201199 ref : 'tree' ,
202200 class : `${ prefixCls } -directory` ,
203201 on : {
204- ...omit ( this . $ listeners, [ 'update:selectedKeys' ] ) ,
202+ ...omit ( listeners , [ 'update:selectedKeys' ] ) ,
205203 select : this . onSelect ,
206204 click : this . onClick ,
207205 dblclick : this . onDoubleClick ,
0 commit comments