// 定位到添加行 const lastRow = this.mainForm.costapplydetailList[this.mainForm.costapplydetailList.length - 1] this.$refs.table.setActiveRow(lastRow) this.$refs.table.setCurrentRow(lastRow) this.$refs.table.scrollToRow(lastRow) }) }...
在使用vxe-table时,要实现被选中行通过setCurrentRow高亮后触发current-change事件,你可以遵循以下步骤来实现: 1. 设置高亮当前行(setCurrentRow) 首先,你需要确保你的vxe-table组件有一个ref属性,这样你可以通过Vue的$refs来访问这个表格实例,并调用setCurrentRow方法来设置高亮行。 在你的Vue组件模板中,可以这样设置...
官网给的事例是这样的: 上面是高亮第一行。 加载完成后,高亮第一行数据。 VxeBasicTable中是这样处理: ...constdata =awaitgetDataFromServer(params); setTimeout(()=>{//高亮第一行let $table =tableRef.value;if($table) { $table.setCurrentRow($table.getProxyInfo()?.data[0]); } },500);retur...
// 通过 reloadData方法获取数据的 通过下边方式 拿到所有的table数据constTABLE_DATA=this.$refs.tableRef.allFullData;// 然后就可以愉快的设置某一行数据了 index 就是你需要哪一行数据高亮this.$refs.tableRef.setCurrentRow(TABLE_DATA[index])// 想要一键删除所有高亮 那么就直接调用 clearCurrentRowthis.$ref...
vxe-table的属性 :header-cell-class-name 表头的样式 :row-class-name 行的样色 :cell-class-name 列的样式 :header-cell-style 表头的动态样色 :row-style行的动态样色 :row-style="setRowClass" methods:{ setRowClass({row, rowIndex}){
toggleTreeExpand({ expanded, row }) { const children = row.children; this.currentRowId = this.$refs.mainTable.getRowid(row); if (children && expanded) { const subNodeCount = this.cacheMap.get(this.currentRowId); setTimeout(() => { ...
特别注意: 如果是通过setValues方法触发的事件,将不会传递row、rowIndex、columnIndex、cellTarget这几个参数的。方法getXTable获取vxe-table 实例,用于调用 vxe-table 的原生方法,详见:VxeTable文档addRows说明:添加一行或多行临时数据,会填充默认值,总是会激活添加的最后一行的编辑模式 参数: rows:[...
{ row: 4, col: 3, rowspan: 1, colspan: 3 } ] demo1.loading = false }, 100) Expand Down 2 changes: 2 additions & 0 deletions 2 examples/views/table/scroll/ScrollFullRows.vue Show comments View file Edit file Delete file This file contains bidirectional Unicode text that may be...
setCurrentRow (row) { const { $el } = this this.clearCurrentRow() this.clearCurrentColumn() this.currentRow = row if (this.highlightCurrentRow) { XEUtils.arrayEach(this.$el.querySelectorAll(`[rowid="${getRowid(this, row)}"]`), elem => addClass(elem, 'row--current')) if ($...
有点类似与 element-ui 但vxe-table显示的形式较多 5、斑马线条纹 (注:在可编辑表格场景下,临时插入的数据不会有斑马纹样式)、高亮 1 <vxe-tablestripe highlight-current-row highlight-hover-row :data="tableData"></vxe-table> 缺点:没有element-ui 可以自定义斑马线的颜色 高亮的颜色 ...