1.0.0 • Published 3 years ago

drag-file-listener v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

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

npm.io

中文文档 | 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

propsmusttypedefaultdescription
selectortrueelement-listen element
droptruefunction-drop event, get the file and directory tree function({ files, filesTree }){}
  • filesTree
[{
  "name": "文件夹名称",
  "fullPath": "路径",
  "chileren": [],  //子文件夹
  "files":  [],  //当前文件夹下文件
}]

Instance Methods

  • remove listener
drager.removeListener()
  • add listener
drager.addListener()
1.0.0

3 years ago

0.1.0

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago