element-ui—— el-upload 自定义上传文件显示列表及固定标签的添加

本文介绍了如何在Element UI的el-upload组件中自定义上传文件的显示列表,并详细讲解了如何添加固定的标签,以增强文件上传功能的用户体验和交互性。
摘要由CSDN通过智能技术生成
<template>
  <div>
    <el-upload class="avatar-uploader" ref="upload" :limit="10" multiple :on-exceed="handleExceed"
      :show-file-list="false" action="https://jsonplaceholder.typicode.com/posts/" :on-change="handlePreview"
      :file-list="fileList" :on-remove="handlePreview" :auto-upload="false">
      <i class="el-icon-upload" slot="trigger"></i>
    </el-upload>
    <div v-if="fileList.length != 0" class="label_remarks">
      <div style="font-size: 12px;color:#bbb;">标签可用空格分隔, 批量添加, 每个图片/视频最多不超过4个标签</div>
      <!-- 固定标签 -->
      <div>
        <span v-for="(item, index) in fixedLabelOptions" :key="index" @click="selectFixedLabel(item.labelName)"><a
            href="#" class="hoverClass">+{
  {item.labelName}}&nbsp;&nbsp;</a></span>
      </div>
    </div>
    <!--  自定义已上传文件列表 -->
    <div class="label_tags">
      <ul class="el-upload-list el-upload-list--text">
        <li tabindex="0" class="el-upload-list__item is-ready&
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值