对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>
相关推荐
花开盛夏^.^4 小时前
电脑打开多个浏览器Web窗口占用较大的运行内存的原因
前端·浏览器
馒头不想说话5 小时前
实体店老板的24小时AI运营员工,写、剪、发全自动,省下一整个团队工资
前端
椒哥7 小时前
一天被问几十次"允许",我统计了 517 次,然后写了个插件
前端·javascript·github
风骏时光牛马7 小时前
生成一个AI稳定性治理及疑难问题分析标题,只需要一个标题,不需要其他的任何文本。
前端
莫西干式秃头7 小时前
用 AI + threejs 写了个浏览器里的 3D 动作游戏《武来》:砍怪、放技能、开 SU7
前端·人工智能·three.js
kyriewen7 小时前
我测了 6 种防请求竞态的写法:只有 1 种真能打
前端·javascript·程序员
孟健7 小时前
用 WorkBuddy 做个人名片网页,挂上开源设计技能后效果完全不同了
前端·人工智能·ai编程
IT_陈寒8 小时前
SpringBoot自动配置的坑,这次终于爬出来了
前端·人工智能·后端
LuHang9 小时前
从天地图切换到高德地图:一次真实的底图迁移实战
前端·vue.js·cesium
用户360055579009 小时前
Kestrel_VLLM - 27 · 寄存器常驻与融合发射:两次「少发一次」
前端