终止el-upload的文件上传

 <div class="answerBox">
	<el-input class="answer" v-model="dataAnswer.answer" style="width: 100%;" :rows="2" type="textarea" placeholder="请在此输入您的答案" resize="none" />
	<div class="input-helper">您已输入{
  { dataAnswer.answer.length }}字div>
	div>
<p class="please_answer">请上传文件p>
 <el-upload v-model:file-list="dataAnswer.file" ref="fileUpload" class="upload-demo" :action="uploadUrl"
                    :before-upload="beforeFileUpload" :on-success="uplpadFileSuccess" :on-remove="removeFile"
                    :headers="headersToken" :on-progress="handleUploadProgress" :show-file-list="false" multiple
                    accept=".rar, .zip, .doc, .docx, .xls, .xlsx, .pdf, .jpg,.jpeg, .png">
                    <el-button type="primary" style="margin-top: 20px;">上传文件el-button>
                    <template #tip>
                        <div class="el-upload__tip">
                            <el-icon style="margin-right: 5px;">
                                <Warning />
                            el-icon> 文件限制100M以内,可上传多个,支持扩展名:rar 、zip 、doc 、docx 、xls、xlsx、pdf、jpg、jpeg、png
                        div>
                    template>
                el-upload>
//直接写的展示列表页面
                <div class="fileContent" v-if="fileList.length > 0">
                    <div v-for="(item, index) in  fileList" class="file">
                        <div class="fileItem">
                            <div class="fileName">
                                <div>
                                    
                                    <svg v-if="!('file_ext' in item)" t="1687317670513" class="icon" viewBox="0 0 1024 1024"
                                        version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4486" width="26" height="26">
                                        <path
                                            d="M918.673 883H104.327C82.578 883 65 867.368 65 848.027V276.973C65 257.632 82.578 242 104.327 242h814.346C940.422 242 958 257.632 958 276.973v571.054C958 867.28 940.323 883 918.673 883z"
                                            fill="#FFCA28" p-id="4487">path>
                                        <path
                                            d="M512 411H65V210.37C65 188.597 82.598 171 104.371 171h305.92c17.4 0 32.71 11.334 37.681 28.036L512 411z"
                                            fill="#FFCA28" p-id="4488">path>
                                        <path
                                            d="M918.673 883H104.327C82.578 883 65 865.42 65 843.668V335.332C65 313.58 82.578 296 104.327 296h814.346C940.422 296 958 313.58 958 335.332v508.336C958 865.32 940.323 883 918.673 883z"
                                            fill="#FFCA28" p-id="4489">path>
                                    svg>
                                    
                                    <svg v-if="'file_ext' in item && (item.file_ext.toLowerCase() == 'doc' || item.file_ext.toLowerCase() == 'docx')"
                                        t="1687317744573" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                        xmlns="http://www.w3.org/2000/svg" p-id="4630" width="26" height="26">
                                        <path
                                            d="M959.16 187.68c2.14-23.23-16.1-41.26-39.32-38.92-108.92-1.76-217.84 0-326.84-0.61V66.64h-60.95C375.86 94.45 219.57 121 63.38 148.35v713c155.38 27.2 310.85 53.18 465.93 81.51H593v-81.51c102 0 203.87-0.2 305.86 0.31 17.32-0.82 36.58 0.51 51.45-10.09 11.92-18.24 8.87-41.06 9.89-61.64-1.45-200.72 0.69-401.53-1.04-602.25z"
                                            fill="#2A5699" p-id="4631">path>
                                        <path
                                            d="M593 178.71h336.21v652.08H593v-81.51h264.9v-40.76H593v-50.94h264.9v-40.76H593v-50.94h264.9v-40.75H593v-50.95h264.9v-40.75H593v-50.94h264.9v-40.76H593v-50.94h264.9V250H593zM115.57 419.49h42.54q14.39 0 21.94 2.38a38.18 38.18 0 0 1 17.38 11.46 55.43 55.43 0 0 1 11 20.18q3.78 11.94 3.78 29.43 0 15.37-3.54 26.51-4.33 13.58-12.35 22-6.05 6.37-16.35 9.94-7.71 2.64-20.6 2.64h-43.8z m23.28 21.06V523h17.38q9.75 0 14.07-1.18a21 21 0 0 0 9.39-5.18q3.74-3.66 6.09-12t2.36-22.81q0-14.43-2.36-22.17t-6.6-12.06a21.6 21.6 0 0 0-10.78-5.87q-4.87-1.18-19.1-1.18zM227.23 482.51q0-19 5.27-31.94a59.12 59.12 0 0 1 10.73-17.07 45.09 45.09 0 0 1 14.9-11.21q10.78-4.93 24.85-4.93 25.48 0 40.77 17.07T339 481.92q0 30.15-15.17 47.18t-40.58 17q-25.72 0-40.89-16.94t-15.13-46.65z m24-0.85q0 21.15 9 32.06a29.54 29.54 0 0 0 45.8 0.09Q315 503 315 481.32q0-21.4-8.69-31.94t-23.08-10.54q-14.39 0-23.19 10.67t-8.83 32.15zM351.31 503.49l22.69-2.38q2 12.31 8.29 18.09t16.82 5.8q11.25 0 16.94-5.14t5.7-12a11.94 11.94 0 0 0-2.4-7.51q-2.4-3.1-8.37-5.39-4.09-1.54-18.64-5.44-18.72-5-26.26-12.32a33.55 33.55 0 0 1-10.62-25.05 33.91 33.91 0 0 1 5-17.8 31.92 31.92 0 0 1 14.39-12.61q9.4-4.34 22.69-4.34 21.7 0 32.67 10.28t11.52 27.44l-23.28 1.1q-1.49-9.6-6.41-13.8t-14.74-4.21q-10.15 0-15.88 4.5a9.33 9.33 0 0 0-3.7 7.73 9.85 9.85 0 0 0 3.46 7.56q4.4 4 21.39 8.33t25.12 9a33.6 33.6 0 0 1 12.74 12.66q4.6 8 4.6 19.84a38.79 38.79 0 0 1-5.51 20A33.64 33.64 0 0 1 424 541.67q-10.07 4.55-25.08 4.55-21.86 0-33.58-10.91t-14.03-31.82z"
                                            fill="#FFFFFF" p-id="4632">

你可能感兴趣的:(javascript,vue.js,前端,elementui)