使用 Polymer 和 material 设计上传文件

File upload with Polymer & material design

我想制作 <input type="file"> 的 paper/material 设计版本,有人可以为我下面的代码提出任何建议吗?

<paper-input type="text" id="fileName" placeholder="File" readonly></paper-input>
<paper-button id="changePicture" class="changePicture">Upload Picture</paper-button>

您需要使用 paper-input-container 获得与纸质输入相同的行为和 material 设计。

如果你有足够的勇气探索其他代码,你可以看看 Vaadin-upload element :)

在 webcomponents.org、https://www.webcomponents.org/search/upload

上查找

例如http://file-input.raynicholus.com/components/file-input/demo.html