How do I add custom attributes to the columns of Table in elementUI?

html Code

now only this information is added to the column by myself. I want to add an id attribute to column, how to add it, or if there is any attribute that I can use to put some custom information

Apr.02,2021

you don't need to use a custom property, you can assign a value to it, and you can get this property in html


mm-hmm, got it. Setting column-key is indeed a method, but considering its uniqueness, it is not appropriate if your custom properties may be duplicated. On the contrary, if the custom attribute is id and unique, you might as well use it boldly.
if you must customize an attribute that does not affect other functions, you can use render-header to render the header, and add the attribute to column during render:

<el-table-column :render-header="renderHeader"></el-table-column>
...
renderHeader(h, { column, $index }) {
  column.test = 'test'
  console.log(column) // 
  return (
    <span></span>
  )
}
...
// :render`ElTable`
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea5a34-1d76.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea5a34-1d76.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?