美文网首页js css html
element plus table 多选变单选

element plus table 多选变单选

作者: 安徒生1997 | 来源:发表于2023-01-05 16:33 被阅读0次

 @select="selectClick".

// 单选

const multipleTableRef = ref()

const selectId = ref({} as any)

const selectClick = (selection: any, row: any) => {

  if (selection.length > 1) {

    let del_row = selection.shift();

    multipleTableRef.value.toggleRowSelection(del_row, false);

  }

  selectId.value = selection?.length ? selection[0] : {}

  // console.log(selectId.value)

}

:deep(.el-table th.el-table__cell:nth-child(1) .cell) {

  visibility: hidden;

}

相关文章

网友评论

    本文标题:element plus table 多选变单选

    本文链接:https://www.haomeiwen.com/subject/txarcdtx.html