From e3f867b6b1b5aab979ad130300cef43aa2f54f7a Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Wed, 20 Nov 2019 15:49:31 +0800 Subject: [PATCH] fix: update dbclick to dblclick #1437 --- components/table/index.en-US.md | 2 +- components/table/index.zh-CN.md | 2 +- components/tree/DirectoryTree.jsx | 12 ++++++------ components/tree/index.en-US.md | 2 +- components/tree/index.zh-CN.md | 2 +- components/vc-cascader/Menus.jsx | 2 +- components/vc-table/demo/rowAndCellClick.js | 2 +- components/vc-tree/src/Tree.jsx | 2 +- types/tree/dictionary-tree.d.ts | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index 21339c061..6d54a6a30 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -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 diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index 74282781c..8c8dafc71 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -88,7 +88,7 @@ const columns = [ }, on: { // 事件 click: (event) => {}, // 点击行 - dbclick: (event) => {}, + dblclick: (event) => {}, contextmenu: (event) => {}, mouseenter: (event) => {}, // 鼠标移入行 mouseleave: (event) => {} diff --git a/components/tree/DirectoryTree.jsx b/components/tree/DirectoryTree.jsx index 7f976eab7..7463e336f 100644 --- a/components/tree/DirectoryTree.jsx +++ b/components/tree/DirectoryTree.jsx @@ -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, }, }; diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index bce06dc7c..7d4ebe349 100644 --- a/components/tree/index.en-US.md +++ b/components/tree/index.en-US.md @@ -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 diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index 8f6b74a8d..89097245d 100644 --- a/components/tree/index.zh-CN.md +++ b/components/tree/index.zh-CN.md @@ -66,7 +66,7 @@ | 参数 | 说明 | 类型 | 默认值 | | ------------ | ------------------------------------------------ | ------ | ------ | -| expandAction | 目录展开逻辑,可选 `false` `'click'` `'dbclick'` | string | click | +| expandAction | 目录展开逻辑,可选 `false` `'click'` `'dblclick'` | string | click | ## FAQ diff --git a/components/vc-cascader/Menus.jsx b/components/vc-cascader/Menus.jsx index d9469fa8a..4814dc1ba 100644 --- a/components/vc-cascader/Menus.jsx +++ b/components/vc-cascader/Menus.jsx @@ -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, diff --git a/components/vc-table/demo/rowAndCellClick.js b/components/vc-table/demo/rowAndCellClick.js index aa6d38197..1fc8bab8f 100644 --- a/components/vc-table/demo/rowAndCellClick.js +++ b/components/vc-table/demo/rowAndCellClick.js @@ -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), }, })} /> diff --git a/components/vc-tree/src/Tree.jsx b/components/vc-tree/src/Tree.jsx index 8b8de599f..c4b86b9e9 100644 --- a/components/vc-tree/src/Tree.jsx +++ b/components/vc-tree/src/Tree.jsx @@ -380,7 +380,7 @@ const Tree = { }, onNodeDoubleClick(e, treeNode) { - this.__emit('dbclick', e, treeNode); + this.__emit('dblclick', e, treeNode); }, onNodeSelect(e, treeNode) { diff --git a/types/tree/dictionary-tree.d.ts b/types/tree/dictionary-tree.d.ts index ea1b04ca3..1ca504871 100644 --- a/types/tree/dictionary-tree.d.ts +++ b/types/tree/dictionary-tree.d.ts @@ -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 */