el-upload,auto-upload=“false“需要提交兩次才能成功

文章讨论了在ElementPlus的el-upload组件中,当设置`auto-upload`为`false`时,用户需要手动触发两次上传操作才能成功。作者提到了`http-request`方法与之关联。

 element-plus的el-upload,auto-upload="false"需要提交兩次才能成功。

需要把:auto-upload="true" 或者刪除

          <el-upload

            ref="uploadRef"

            :auto-upload="false"

            name="file"

            :http-request="attachEmailFile"

          >

            <template #trigger>

              <el-button type="primary">select file</el-button>

            </template>

          </el-upload>

<el-upload class="custom-uploader" style="display: inline;float:right; margin-top: 10px" action="#" ref="fileupload" :multiple="false" :on-change="change" :limit="10" :auto-upload="false" accept="application/pdf" :show-file-list="false"> <el-button class="upload-btn" size="medium" type="text" plain>附件更新 <i class="el-icon-upload el-icon--right"></i> </el-button> </el-upload> <b class="levelonetitle">附件</b> <div id="visitexcel"> <div> <!-- 表格 --> <el-table id="el-table" :data="localVisitexcelData" v-loading="loading" element-loading-text="加载中,请稍候..." border max-height="540" :header-cell-class-name="headerRow" :row-style="{height:'40px'}" :cell-style="{padding:'7px 0'}"> <!-- <el-table-column prop="附件文件名" label="附件文件名" width="720" align="center"> </el-table-column> --> <el-table-column v-for="(value, key) in localVisitexcelData[0]" :key="key" prop="fileName" label="文件名" align="center" ></el-table-column> <el-table-column label="操作" align="center"> <template slot-scope="scope"> <el-button size="mini" icon="el-icon-view" @click="handleView(scope.$index, scope.row)"> 查阅 </el-button> <!-- 删除按钮漂浮框 --> <el-popover width="160" :ref="`popover-${scope.$index}`" placement="left"> <p>文件删除后无法恢复,请确认 <span style="color:red">删除?</span> </p> <div style="text-align: right; margin: 0"> <el-button type="text" size="mini" @click="scope._self.$refs[`popover-${scope.$index}`].doClose()"> 取消 </el-button> <el-button type="danger" size="mini" @click="handleDelete(scope)">确定</el-button> </div> <el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left:10px" slot="reference">删除</el-button> </el-popover> </template> </el-table-column> </el-table> </div> 将上传的文件名显示在el-table中
09-02
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值