element ui table 中的selection实现单选+点击任意位置选中

  • 首先去除左上角的那一个全选按钮

     

    这里用的方法是css ,让他display: none:

  • thead {
        .el-table-column--selection {
          .cell {
            display: none;
          }
        }
      }
  • 如果要实现点击table一列的任意位置就勾选上,要用到@current-change这个属性来当点击表格当前行触发事件,可用如下方式:
  • this.$refs.Table.toggleRowSelection(val)

猜你喜欢

转载自blog.csdn.net/weixin_38291260/article/details/89917068
今日推荐