提交 8a7374d1 authored 作者: zhangdaiscott's avatar zhangdaiscott

修复【issues/4019】修复JVxeTable默认行数无效

上级 0f167201
...@@ -53,11 +53,14 @@ export const JVxeTableMixin = { ...@@ -53,11 +53,14 @@ export const JVxeTableMixin = {
console.warn('由于你没有在 data 中定义 addDefaultRowNum 或 addDefaultRowNum 不是数字,所以默认添加一条空数据,如果不想默认添加空数据,请将定义 addDefaultRowNum 为 0') console.warn('由于你没有在 data 中定义 addDefaultRowNum 或 addDefaultRowNum 不是数字,所以默认添加一条空数据,如果不想默认添加空数据,请将定义 addDefaultRowNum 为 0')
} }
//update-begin-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349 //update-begin-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
this.eachAllTable((item) => { if (rowNum > 0) {
setTimeout(()=>{ let newRows = new Array(rowNum).fill({})
item.addRows() this.eachAllTable((item) => {
}, 30) setTimeout(()=>{
}) item.addRows(newRows)
}, 30)
})
}
//update-end-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349 //update-end-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
if (typeof this.addAfter === 'function') this.addAfter(this.model) if (typeof this.addAfter === 'function') this.addAfter(this.model)
this.edit({}) this.edit({})
......
...@@ -52,13 +52,16 @@ export const JVxeTableModelMixin = { ...@@ -52,13 +52,16 @@ export const JVxeTableModelMixin = {
rowNum = 1 rowNum = 1
console.warn('由于你没有在 data 中定义 addDefaultRowNum 或 addDefaultRowNum 不是数字,所以默认添加一条空数据,如果不想默认添加空数据,请将定义 addDefaultRowNum 为 0') console.warn('由于你没有在 data 中定义 addDefaultRowNum 或 addDefaultRowNum 不是数字,所以默认添加一条空数据,如果不想默认添加空数据,请将定义 addDefaultRowNum 为 0')
} }
this.eachAllTable((item) => { if (rowNum > 0) {
//update-begin-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349 let newRows = new Array(rowNum).fill({})
setTimeout(()=>{ this.eachAllTable((item) => {
item.addRows() //update-begin-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
}, 30) setTimeout(()=>{
//update-end-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349 item.addRows(newRows)
}) }, 30)
//update-end-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349
})
}
if (typeof this.addAfter === 'function') this.addAfter(this.model) if (typeof this.addAfter === 'function') this.addAfter(this.model)
this.edit(this.model) this.edit(this.model)
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论