tableAddRowBefore代码生成器设置行内编辑,主表点击添加行时设置默认值
[vue3代码]写在生成的[表.vue]文件中,[vue2代码]写在[表.jsx]文件methods方法中;二选一实现
vue3代码
//生成的vue标签上添加方法
<view-grid :tableAddRowBefore="tableAddRowBefore"></view-grid>
//newRow添加的新行数据,可以设置默认值
//currentRow当前点击的这一行数据
const tableAddRowBefore=(newRow,currentRow,index)=> {
row.字段=值;//设置默认值
return true;
}
vue2 代码
//newRow添加的新行数据,可以设置默认值
//currentRow当前点击的这一行数据
tableAddRowBefore(newRow,currentRow,index){
row.字段=值;//设置默认值
return true;
}
