< 文件附加> 元素
通过拖放或文件输入来附加文件.
安装
$ npm install @github/file-attachment-element
使用量
import '@github/file-attachment-element'
<file-attachment directory>
<input type="file" multiple />
</file-attachment>
可选属性
file-attachment[directory]允许翻转目录.file-attachment[input]指向内部文件输入的ID<file-attachment>。如果提供了,则只从相应的文件中选择文件<input>将附于<file-attachment>。 。 。 .
样式拖动状态
布尔 [hover] 属性存在于 <file-attachment> 时的文件会被拖过元素.
file-attachment[hover] { border: 2px dashed grey; }
活动
file-attachment-accept- 文件被扔到元素上。 打电话event.preventDefault()防止下降。 泡泡s.file-attachment-accepted– 文件被添加到附件列表中,可由主机应用程序上传. 泡泡s.
浏览器支持
浏览器, 不本地 自定义元素支持 需要一个 多边填充。 。 。 .
- 颜色
- 火花
- 萨法里
- 微软边缘
发展
npm install
npm test
许可证
以麻省理工学院许可证分发。 详情见LICENSE.