对el-upload的上传文件显示名做长度限制

通过css样式my-upload对el-upload的上传文件显示名做长度限制

ini 复制代码
<el-upload
                  style="
                    display: flex;
                    flex-direction: column;
                    align-items: flex-start;
                  "
                  :action="x"
                  class="upload-demo my-upload"
                  :headers="{ token: $cookie.get('token') }"
                  ref="upload"
                  :on-preview="p_onPreview"
                  :on-success="
                    (response, file, fileList) => {
                      p_onSuccess(response, file, fileList, 'decideDoc');
                    }
                  "
                  :before-upload="beforeVideoUpload"
                  :on-remove="
                    (file, fileList) => {
                      handleRemove2(file, fileList, 'decideDoc');
                    }
                  "
                  :before-remove="beforeRemove"

                  :file-list="p_fileList_decideDoc"
                  :limit="3"
                  :on-exceed="
                    (files, fileList) => {
                      $message.warning(
                        `当前限制选择 3 个文件,本次选择了 ${
                          files.length
                        } 个文件,共选择了 ${
                          files.length + fileList.length
                        } 个文件`
                      );
                    }
                  "
                >
                  <el-button
                    slot="trigger"
                    size="mini"
                    type="primary"
                    icon="el-icon-upload2"
                    v-if="method != 'view'"
                    >上传附件</el-button
                  >
                </el-upload>
xml 复制代码
<style lang="scss" scoped>
.my-upload ::v-deep .el-upload-list__item-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
</style>
相关推荐
Mr Xu_26 分钟前
【Vue3 + ECharts 实战】正确使用 showLoading、resize 与 dispose 避免内存泄漏
前端·信息可视化·vue·echarts
0思必得033 分钟前
[Web自动化] Selenium设置相关执行文件路径
前端·爬虫·python·selenium·自动化
雯0609~43 分钟前
hiprint:实现项目部署与打印1-官网提供普通html版本
前端·html
不绝1911 小时前
UGUI——进阶篇
前端
Exquisite.2 小时前
企业高性能web服务器(4)
运维·服务器·前端·网络·mysql
2501_944525542 小时前
Flutter for OpenHarmony 个人理财管理App实战 - 账户详情页面
android·java·开发语言·前端·javascript·flutter
2601_949857432 小时前
Flutter for OpenHarmony Web开发助手App实战:快捷键参考
前端·flutter
wangdaoyin20102 小时前
若依vue2前后端分离集成flowable
开发语言·前端·javascript
心柠3 小时前
vue3相关知识总结
前端·javascript·vue.js
Amumu121383 小时前
Vue Router(二)
java·前端