vue中重写上传文件input框的方法
//vue中重写上传文件input框的方法
//html
<div class="upload_reveal">
选择图片
<input class="upload_file"
type="file"
name="file"
id="input-pay-proof"
@change="chooseImage()"
accept="image/*" />
</div>
//css
.upload_reveal {
display: inline-block;
width: 100px;
height: 30px;
line-height: 30px;
background: #409EFF;
position: relative;
text-align: center;
color: #FFFFFF;
border-radius: 5px;
}
.upload_file {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
/*透明度为0*/
opacity: 0;
cursor: pointer;
}
//css 底部导航栏弹性布局
.css{
display: flex;
justify-content: space-between;
}
共 0 条评论