对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>
相关推荐
天***885215 分钟前
Edge 浏览器离线绿色增强版+官方安装包,支持win7等系统
前端·edge
漫游的渔夫23 分钟前
别再直接 `json.loads` 了!AI 返回的 JSON 坑位指南
前端·人工智能
软件工程师文艺35 分钟前
从0到1:Claude Code如何用React构建CLI应用
前端·react.js·前端框架
M ? A1 小时前
Vue 迁移 React 实战:VuReact 一键自动化转换方案
前端·vue.js·经验分享·react.js·开源·自动化·vureact
yuki_uix1 小时前
重排、重绘与合成——浏览器渲染性能的底层逻辑
前端·javascript·面试
沃尔威武1 小时前
调试黑科技:Chrome DevTools时间旅行调试实战
前端·科技·chrome devtools
yuki_uix1 小时前
虚拟 DOM 与 Diff 算法——React 性能优化的底层逻辑
前端·react.js·面试
yuki_uix1 小时前
从输入 URL 到页面显示——浏览器工作原理全解析
前端·面试
weixin_408099672 小时前
【完整教程】天诺脚本如何调用 OCR 文字识别 API?自动识别屏幕文字实战(附代码)
前端·人工智能·后端·ocr·api·天诺脚本·自动识别文字脚本
吴声子夜歌2 小时前
ES6——Generator函数详解
前端·javascript·es6