diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md index a46c4fd707d8affcf589837d79a79bbf38f6b912..2dfb94304f064bc0ea63f40063eed74dc2c2d9e2 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md @@ -326,15 +326,13 @@ struct DragExample { console.log('List onDragLeave, ' + extraParams + 'X:' + event.getX() + 'Y:' + event.getY()) }) .onDrop((event: DragEvent, extraParams: string) => { - if (!extraParams.empty()) { - let jsonString = JSON.parse(extraParams); - if (this.bool) { - // 通过splice方法插入元素 - this.numbers.splice(jsonString.insertIndex, 0, this.text) - this.bool = false - } - this.fruitVisible[this.idx] = Visibility.None + let jsonString = JSON.parse(extraParams); + if (this.bool) { + // 通过splice方法插入元素 + this.numbers.splice(jsonString.insertIndex, 0, this.text) + this.bool = false } + this.fruitVisible[this.idx] = Visibility.None this.getDataFromUDMFWithRetry(event); }) }.width('100%').height('100%').padding({ top: 20 }).margin({ top: 20 })