项目中有需要动态添加和删除 el-table 行的需要,就学习了下,发现很简单:
<template>
<el-dialog
width="50%"
:visible.sync="isShow"
:before-close="beforeClose"
title="自定义设备类型属性">
<div class="dialogDiv">
<el-table
:data="tableData.filter(data => handleAdd || data.name.toLowerCase().includes(handleAdd.toLowerCase()))"
style="width: 100%" border>
<el-table-column prop="code"
:label="$t('basicData.device.propDlg.code')">
</el-table-column>
<el-table-column prop="maxValue"
:label="$t('basicData.device.propDlg.maxValue')">
</el-table-column>
<el-table-column prop="minValue"
:label="$t('basicData.device.propDlg.minValue')">
</el-table-column>
<el-table-column prop