element-ui的upload組件的clearFiles方法


1 <template>
2     <div>
3         <el-button @click="clearFiles">重新上傳</el-button>
4         <el-upload ref="my-upload">
5             <el-button type="primary">點擊上傳</el-button>
6         </el-upload>
7     </div>
8 </template>

方法調用

 1 <script>
 2     export default {
 3         data(){
 4             return {
 5         }
 6     },
 7     methods: {
 8         clearFiles () {
 9             this.$refs['my-upload'].clearFiles();
10         }
11     }
12 };


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM