1 <template> 2 <div id="app"> 3 <input type="file" ref="upload"> 4 <button @click="uploadHandle">点击上传</button> 5 </div> 6 7 </template> 8 9 <script> 10 11 export default { 12 data() { 13 return { 14 msg:"", 15 } 16 }, 17 methods: { 18 uploadHandle(){ 19 // console.log(this.msg) 20 console.log(this.$refs.upload.files) 21 } 22 } 23 } 24 </script>
原文地址:https://www.cnblogs.com/hrose/p/12163232.html
时间: 2024-11-07 23:30:44