vue uses elementui, to write a lot of headers every time he writes table. How to specify a default value for each item in the header of a table component through props,. If I want to specify a width for each item, it can be sorted. The current default, does not work
.<template>
<el-table :data="tableData" stripe highlight-current-row v-loading="listLoading">
<el-table-column v-for="item in tableHeader" :prop="item.prop" :label="item.label" :sortable="item.sortable" :show="item.show" :width="item.width"></el-table-column>
</el-table>
</template>
<script>
export default {
props:{
tableHeader:{
type:Array,
default:()=>[{prop:"",label:"",sortable:true,width:100,show:true}]
},
tableData:{
type:Array,
default:()=>[]
},
listLoading:false
}
}
</script>