element table 选中高亮

2,348 阅读1分钟

利用属性highlight-current-row,该属性对应类名是.current-row

<template>
  <el-table
    v-loading="loading"
    :data="listData"
    :highlight-current-row="true"
  >
  </el-table>
</template>

<style lang="scss" scope>
/deep/ .current-row>td {
    border: 1px solid #1890ff;
    border-left: none;
    border-right: none;
    &:first-child {
      border-left: 1px solid #1890ff;
    }
    &:last-child {
      border-right: 1px solid #1890ff;
    }
  }
</style>