methods: selectedHighlight ({ row, r..._element-ui highlight-se">
赞
踩
效果如图:
html:
- <el-table
- class="box"
- :data="tableData"
- :height="height"
- tooltip-effect="dark"
- :row-style="selectedHighlight"
- @selection-change="handDrawer"
- >
methods:
- selectedHighlight ({ row, rowIndex }) {
- if (this.selectRow.includes(rowIndex)) {
- return {
- 'background-color': '#15499A'
- }
- }
- },
- // 获取勾中表单
- handDrawer (val) {
- this.buttonList = val
- },
watch:
- watch: {
- buttonList (data) {
- this.selectRow = []
- if (data.length > 0) {
- data.forEach((item, index) => {
- this.selectRow.push(this.tableData.indexOf(item))
- })
- }
- }
- },
亲测有效!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。