资讯

展开

element-UI-table-新增定位-设置第一行高亮

作者:快盘下载 人气:
<el-table
      :height=;ii_tableHeight; 
      :data=;ia_tableData;
      align=;center;
      v-loading=;ib_loading;
      ;sort-change=;handleSortChange;
      :header-cell-style=;{ background: ;#F5F7FA; };
      ref=;refGrid;
      ;current-change=;handleCurRowChange;
      ;row-click=;handleRowClick;
      Highlight-current-row 
      border 
      :stripe=;true;
      :key=;is_tableRandomKey;
     :cell-style=;handleCellStyle;
    >
</el-table>
:header-cell-style=;{ background: ;#1b69de; }; //行高亮的样式设置
选择某一行
this.$refs.refGrid.toggleRowSelection(aRow,true);
设置某一行高亮
this.$refs.refGrid.setCurrentRow(this.ia_tableData[0]);

父组件;

addNewRow(aRow){
 this.ia_tableData.unshift(aRow);
   this.$nextTick(()=>{
     this.$refs.refGrid.toggleRowSelection(aRow,true);
     this.$refs.refGrid.setCurrentRow(this.ia_tableData[0]);
   })
},

子组件;

this.$nextTick(()=>{
             this.$refs.EBOM_OUTFILE_Main.addNewRow({
               AIRNAME:io_ret_main_key.AIRNAME,
               CLENAME:io_ret_main_key.CLENAME,
               CNCINFO:io_ret_main_key.CNCINFO,
               CNCSTATUS:io_ret_main_key.CNCSTATUS,
               CREATNAME:io_ret_main_key.CREATNAME,
               CNCSTATUSNM:io_ret_main_key.CNCSTATUSNM,
               CREATDATE:io_ret_main_key.CREATDATE,
               CREATID:io_ret_main_key.CREATID,
               EECNC:io_ret_main_key.EECNC,
               FILEID:io_ret_main_key.FILEID,
               FILEID_PDF:io_ret_main_key.FILEID_PDF,
               FINAME:io_ret_main_key.FINAME,
               FITYPE:io_ret_main_key.FITYPE,
               ROWID:io_ret_main_key.ROWID,
               SENDUNIT:io_ret_main_key.SENDUNIT,
               SENDUNIT_NAME:io_ret_main_key.SENDUNIT_NAME,
               TITLE:io_ret_main_key.TITLE,
               TYPEDESCNAME:io_ret_main_key.TYPEDESCNAME,
             })
           })

加载全部内容

相关教程
猜你喜欢
用户评论
快盘暂不提供评论功能!