js css html

element plus table 多选变单选

2023-01-05  本文已影响0人  安徒生1997

 @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;

}

上一篇 下一篇

猜你喜欢

热点阅读