下拉框不同内容搭配不同颜色的前缀圆点

 <el-table-column prop="disposalStatus" label="" >
          <template slot-scope="scope">
            <div class="select_bg">
              <div :style="{ background: disposalStatus[+scope.row.disposalStatus].color }" class="select_color">
              </div>
              <el-select size="mini" v-model="scope.row.disposalStatus" @change="handleDisposalStatus(scope.row)"
                class="status">
                <el-option v-for="item in disposalStatus" :key="item.value" :label="item.label" :value="item.value">
                  <div class="statusPoint">
                    <div :style="{ background: item.color }" alt="" />
                    {{ item.label }}

                  </div>
                </el-option>
              </el-select>
            </div>

          </template>
        </el-table-column>
disposalStatus: [
        { value: 0, label: "状态1", color: "#ff5962" },
        { value: 1, label: "状态2", color: '#4386f4' },
        { value: 2, label: "状态3", color: "#9fa1a0" },
        { value: 3, label: "状态4", color: "#464acd" },
        { value: 4, label: "状态5", color: "#f18045" },
        { value: 5, label: "状态6", color: "#00d591" },
      ],
.select_bg {
  position: relative;

  .select_color {
    position: absolute;
    top: 9px;
    left: 0px;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    background: transparent;
    z-index: 999;
  }

}

  • 7
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值