<div @click="upload">点击我上传</div>
<input ref="input" style="display:none" type="file"/>
upload(){
this.refs.input.dispatchEvent(new MouseEvent('click'));
}
<div @click="upload">点击我上传</div>
<input ref="input" style="display:none" type="file"/>
upload(){
this.refs.input.dispatchEvent(new MouseEvent('click'));
}
本文标题:不显示input 点击其他元素时触发input的点击事件
本文链接:https://www.haomeiwen.com/subject/gntdnktx.html
网友评论