注意:input[type="file"] 标签中的属性accept="application/msword,application/pdf" 在pc上正常,但是在手机ios和android上这个文件格式限制会被忽略,所以需要在js中增加格式的判断,以及对应显示样式的设置.(我也是刚发现,如果有遇到这个问题的可以参考下---下面有更改:)
```
Apply Online Apply online Thank you for applying to this job! ```#my-careers{ .content{ padding: 0.5rem 0.2rem 0; text-align: left; h3{ font-size:0.16rem; padding: 0.15rem 0; } .form-group{ li{ position: relative; width:100%; margin-bottom:0.24rem; color:#999; display:flex; input,textarea{ width:93.5%; padding:0.09rem 3%; border:1px solid #ddd; border-radius:0.03rem; vertical-align: top; font-size: 0.14rem; } *::placeholder{ color:#999; } } .reason-li{ textarea{font-family: inherit;} span{ position:absolute; font-size:0.14rem; right: 0.05rem; bottom: 0; } } .info-reason{ textarea{resize: none;} } .info-file{ display:block; border:1px dashed #eee; font-size: 0.14rem; text-align: center; padding:0.13rem 0 0.1rem; margin-bottom:0.15rem; height:0.59rem; .file-span{ color:#999; background:#fff; padding:0.02rem 0.1rem; margin-bottom:0.05rem; border:1px solid #ddd; border-radius:3px; box-shadow:0 2px 5px #999; } p{ position: relative; line-height:0.2rem; color:#999; span{ color:#0b9d78; } input{ position: absolute; width:0.66rem; opacity: 0; display:inline-block; padding:0; border:0; } } } .info-btns{ margin-bottom:0; button{ width:2rem; padding:0.06rem 0; font-size: 0.16rem; color:#999; background: #eee; border-radius: 0.03rem; margin:auto; } .active{ color:#fff; background: #ffa000; } } .errli{ border:1px solid #d32f2f; } .errP{ position: absolute; font-size:0.14rem; color:#d32f2f; left: 0; bottom: -0.2rem; padding-left:3%; } } } .career-cover{ width: 100%; height: 100%; position:absolute; top: 0; left: 0; background: rgba(0, 0, 0, 0.5); z-index:10; } .career-dialog{ width:2.8rem; position: absolute; top: 35%; left: 0; right: 0; margin:auto; z-index:11; background:rgba(255, 255, 255, 1); padding:0.3rem 0.2rem; border-radius:5px; overflow: hidden; .d-top{ font-size: 0.14rem; color:#666; display:flex; align-items: center; font-weight: bold; } .d-top::after{ display:block; content:""; flex:1; margin-left:0.15rem; border-top:1px solid #999; } .d-center{ padding:0.3rem 0; color:#0b9d78; font-size: 0.16rem; font-weight: bold; } .d-bottom{ position: relative; height:0.3rem; margin-bottom:0.15rem; button{ position: absolute; width:2rem; padding:0.1rem 0; font-size: 0.16rem; color:#fff; background: #ffa000; border-radius:3px; left: 0; right: 0; margin:auto; z-index:9; } } img{ opacity: 0.2; position:absolute; width:1.8rem; top: 0.5rem; right: -0.1rem; z-index:8; } } }
总结
以上所述是小编给大家介绍的vue中使用input[type="file"]实现文件上传功能,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对考高分网网站的支持!


![vue中使用input[type="file"]实现文件上传功能 vue中使用input[type="file"]实现文件上传功能](http://www.mshxw.com/aiimages/31/79247.png)
