如何使用角度材料2 FAB按钮打开浏览输入对话框?这可以通过这种方式在
HTML中完成.
<button type="button"> <label for="file-input">click</label> </button> <input type="file" id="file-input" style="display:none">
我尝试使用与材料2相同的方法,但它不起作用.
<button md-mini-fab type="button"> <label for="filetoUpload"> <md-icon>add</md-icon> </label> </button> <input id="filetoUpload" type="file" style="display:none;">
还有其他方法可行吗?谢谢.
您只需触发文件输入的单击即可.
<button md-mini-fab type="button" onclick="document.getElementById('filetoUpload').click()"> <label for="filetoUpload"><md-icon>add</md-icon></label> </button> <input id="filetoUpload" type="file" style="display:none;">
原文地址:https://www.jb51.cc/angularjs/141081.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。