fix: update dbclick to dblclick #1437
							parent
							
								
									cece7332cb
								
							
						
					
					
						commit
						e3f867b6b1
					
				|  | @ -88,7 +88,7 @@ Same as `customRow` `customHeaderRow` `customCell` `customHeaderCell`. Follow [V | |||
|       }, | ||||
|       on: { | ||||
|         click: (event) => {},       // click row | ||||
|         dbclick: (event) => {}, // double click row | ||||
|         dblclick: (event) => {}, // double click row | ||||
|         contextmenu: (event) => {}  // right button click row | ||||
|         mouseenter: (event) => {}   // mouse enter row | ||||
|         mouseleave: (event) => {}   // mouse leave row | ||||
|  |  | |||
|  | @ -88,7 +88,7 @@ const columns = [ | |||
|       }, | ||||
|       on: { // 事件 | ||||
|         click: (event) => {},       // 点击行 | ||||
|         dbclick: (event) => {}, | ||||
|         dblclick: (event) => {}, | ||||
|         contextmenu: (event) => {}, | ||||
|         mouseenter: (event) => {},  // 鼠标移入行 | ||||
|         mouseleave: (event) => {} | ||||
|  |  | |||
|  | @ -10,7 +10,7 @@ import BaseMixin from '../_util/BaseMixin'; | |||
| import { initDefaultProps, getOptionProps } from '../_util/props-util'; | ||||
| import { ConfigConsumerProps } from '../config-provider'; | ||||
| 
 | ||||
| // export type ExpandAction = false | 'click' | 'dbclick'; export interface | ||||
| // export type ExpandAction = false | 'click' | 'dblclick'; export interface | ||||
| // DirectoryTreeProps extends TreeProps {   expandAction?: ExpandAction; } | ||||
| // export interface DirectoryTreeState {   expandedKeys?: string[]; | ||||
| // selectedKeys?: string[]; } | ||||
|  | @ -33,7 +33,7 @@ export default { | |||
|   props: initDefaultProps( | ||||
|     { | ||||
|       ...TreeProps(), | ||||
|       expandAction: PropTypes.oneOf([false, 'click', 'doubleclick', 'dbclick']), | ||||
|       expandAction: PropTypes.oneOf([false, 'click', 'doubleclick', 'dblclick']), | ||||
|     }, | ||||
|     { | ||||
|       showIcon: true, | ||||
|  | @ -104,12 +104,12 @@ export default { | |||
|       const { expandAction } = this.$props; | ||||
| 
 | ||||
|       // Expand the tree | ||||
|       if (expandAction === 'dbclick' || expandAction === 'doubleclick') { | ||||
|       if (expandAction === 'dblclick' || expandAction === 'doubleclick') { | ||||
|         this.onDebounceExpand(event, node); | ||||
|       } | ||||
| 
 | ||||
|       this.$emit('doubleclick', event, node); | ||||
|       this.$emit('dbclick', event, node); | ||||
|       this.$emit('dblclick', event, node); | ||||
|     }, | ||||
| 
 | ||||
|     onSelect(keys, event) { | ||||
|  | @ -185,7 +185,7 @@ export default { | |||
|     const { _expandedKeys: expandedKeys, _selectedKeys: selectedKeys } = this.$data; | ||||
|     warning( | ||||
|       !this.$listeners.doubleclick, | ||||
|       '`doubleclick` is deprecated. please use `dbclick` instead.', | ||||
|       '`doubleclick` is deprecated. please use `dblclick` instead.', | ||||
|     ); | ||||
|     const treeProps = { | ||||
|       props: { | ||||
|  | @ -201,7 +201,7 @@ export default { | |||
|         ...omit(this.$listeners, ['update:selectedKeys']), | ||||
|         select: this.onSelect, | ||||
|         click: this.onClick, | ||||
|         dbclick: this.onDoubleClick, | ||||
|         dblclick: this.onDoubleClick, | ||||
|         expand: this.onExpand, | ||||
|       }, | ||||
|     }; | ||||
|  |  | |||
|  | @ -66,7 +66,7 @@ One of the Tree `treeNode` prop for describing the tree's node, TreeNode has the | |||
| 
 | ||||
| | Property     | Description                                                  | Type   | Default | | ||||
| | ------------ | ------------------------------------------------------------ | ------ | ------- | | ||||
| | expandAction | Directory open logic, optional `false` `'click'` `'dbclick'` | string | click   | | ||||
| | expandAction | Directory open logic, optional `false` `'click'` `'dblclick'` | string | click   | | ||||
| 
 | ||||
| ## FAQ | ||||
| 
 | ||||
|  |  | |||
|  | @ -66,7 +66,7 @@ | |||
| 
 | ||||
| | 参数         | 说明                                             | 类型   | 默认值 | | ||||
| | ------------ | ------------------------------------------------ | ------ | ------ | | ||||
| | expandAction | 目录展开逻辑,可选 `false` `'click'` `'dbclick'` | string | click  | | ||||
| | expandAction | 目录展开逻辑,可选 `false` `'click'` `'dblclick'` | string | click  | | ||||
| 
 | ||||
| ## FAQ | ||||
| 
 | ||||
|  |  | |||
|  | @ -61,7 +61,7 @@ export default { | |||
|         }, | ||||
|         on: { | ||||
|           click: onSelect, | ||||
|           dbclick: onItemDoubleClick, | ||||
|           dblclick: onItemDoubleClick, | ||||
|           mousedown: e => e.preventDefault(), | ||||
|         }, | ||||
|         key: Array.isArray(key) ? key.join('__ant__') : key, | ||||
|  |  | |||
|  | @ -116,7 +116,7 @@ export default { | |||
|         customRow={(record, index) => ({ | ||||
|           on: { | ||||
|             click: onRowClick.bind(null, record, index), | ||||
|             dbclick: onRowDoubleClick.bind(null, record, index), | ||||
|             dblclick: onRowDoubleClick.bind(null, record, index), | ||||
|           }, | ||||
|         })} | ||||
|       /> | ||||
|  |  | |||
|  | @ -380,7 +380,7 @@ const Tree = { | |||
|     }, | ||||
| 
 | ||||
|     onNodeDoubleClick(e, treeNode) { | ||||
|       this.__emit('dbclick', e, treeNode); | ||||
|       this.__emit('dblclick', e, treeNode); | ||||
|     }, | ||||
| 
 | ||||
|     onNodeSelect(e, treeNode) { | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ import { Tree } from './tree'; | |||
| 
 | ||||
| export declare class DictionaryTree extends Tree { | ||||
|   /** | ||||
|    * Directory open logic, optional false 'click' 'doubleclick' | ||||
|    * Directory open logic, optional false 'click' 'dblclick' | ||||
|    * @default 'click' | ||||
|    * @type string | ||||
|    */ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 tanjinzhou
						tanjinzhou