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
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
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`
Previous: Iview's select component search function searches both label and value
Next: Using the vue-cli project of the iview framework, how to get the width? of the tag tag