https://github.com/nichoth/vdom-file-upload
File upload widget for virtual-dom
https://github.com/nichoth/vdom-file-upload
Last synced: 3 months ago
JSON representation
File upload widget for virtual-dom
- Host: GitHub
- URL: https://github.com/nichoth/vdom-file-upload
- Owner: nichoth
- Created: 2015-11-08T02:17:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-13T21:10:04.000Z (over 10 years ago)
- Last Synced: 2024-12-19T01:32:52.184Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://8e481e51d65c8cbb88f6fc630831d2e083d3e05c.htmlb.in
- Size: 0 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# vdom file upload
File upload UI component for virtual dom rendering engine.
[demo](https://8e481e51d65c8cbb88f6fc630831d2e083d3e05c.htmlb.in)
## install
$ npm install vdom-file-upload
## example
```js
var vdom = require('virtual-dom');
var FileUpload = require('vdom-file-upload');
// return `observ-struct` instance
var state = FileUpload({
label: 'example',
onChange: function(files) {
console.log('change', files);
}
});
var loop = require('main-loop')(
state(),
// pass in a hyperscript function
FileUpload.render.bind(null, vdom.h),
vdom
);
state(loop.update);
document.getElementById('content').appendChild(loop.target);
```