Skip to content

Commit 4f9683f

Browse files
authored
fix(grid): [grid] fix drop-config trigger don't work (#2178)
1 parent 2e0e14b commit 4f9683f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/vue/src/grid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@opentiny/vue-grid",
33
"type": "module",
4-
"version": "3.18.2",
4+
"version": "3.18.3",
55
"description": "",
66
"license": "MIT",
77
"sideEffects": false,

packages/vue/src/grid/src/dragger/src/methods.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,16 @@ export default {
6565
},
6666
// 处理行拖拽
6767
rowDrop(bodyEl) {
68-
const { plugin, onBeforeMove, filter, refresh = true, rowHandle } = this.dropConfig
68+
const { plugin, onBeforeMove, filter, refresh = true, rowHandle, trigger } = this.dropConfig
6969
const rowDropContainer = bodyEl.querySelector('.tiny-grid__body tbody')
70-
70+
// 拖拽触发源,默认是行
71+
let handle = trigger || '.tiny-grid-body__row'
72+
// 配置了 rowHandle === 'index'则忽略trigger
73+
if (rowHandle === 'index') {
74+
handle = '.tiny-grid-body__row>td.col__index>.row__drop-handle'
75+
}
7176
const rowDropOptions = {
72-
handle: rowHandle === 'index' ? '.tiny-grid-body__row>td.col__index>.row__drop-handle' : '.tiny-grid-body__row',
77+
handle,
7378
filter,
7479
onEnd: createHandlerOnEnd({ _vm: this, refresh }),
7580
onStart: (event) => {

0 commit comments

Comments
 (0)