<input type="file" ref="file" style="display: none" >
<input type='text' ref="fileName" readonly="readonly" @click="$refs.file.click()">
<p></p>
<el-input type='text' readonly="readonly" @click.native="triggerClick"></el-input>

js代码

 triggerClick(){

      this.$refs.file.dispatchEvent(new MouseEvent('click'))
    }

 

Logo

前往低代码交流专区

更多推荐