The listener element drags and drops into the file and returns the file and directory tree

中文文档 | Englist doc
DEMO
codesandbox
Installation
yarn add drag-file-listener
Using
import Drag from 'drag-file-listener'
const drager = new DragLitener({
selector: document.querySelector('.drag'),
drop: ({ file, filesTree }) => {}
})
option
selector | true | element | - | listen element |
drop | true | function | - | drop event, get the file and directory tree function({ files, filesTree }){} |
[{
"name": "文件夹名称",
"fullPath": "路径",
"chileren": [],
"files": [],
}]
Instance Methods
drager.removeListener()
drager.addListener()