scriptdata() { return { data:[], getIndex:"", }},met_element ui 表格第一行变色">
赞
踩
template
<el-table
:data="data"
:row-class-name="tableRowClassName" //设置类
:row-style="selectedstyle" //设置行的样式
@row-click="rowClick" //点击
>
</el-table>
script
data() { return { data:[], getIndex:"", } }, methods: { selectedstyle ({row, rowIndex}) { if ((this.getIndex) === rowIndex ) { return { "background-color": "red" }; } }, tableRowClassName ({row, rowIndex}) { row.index = rowIndex; }, rowClick (row) { this.getIndex=row.index } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。