Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVxeTable默认行数无效 #4019

Closed
Haowensheng opened this issue Sep 1, 2022 · 3 comments
Closed

JVxeTable默认行数无效 #4019

Haowensheng opened this issue Sep 1, 2022 · 3 comments

Comments

@Haowensheng
Copy link

版本号:3.1.0
前端版本:vue2
问题描述:JVxeTable默认行数不好使,业务需求中不能有默认行数,于是设置addDefaultRow,

但是设置之后无效,看了之前的issues也有这个问题 但未解决 看了看代码 发现代码中没有判断行数,于是改了改,目前暂时试着没问题
不知道这样改合不合适,暂时没发现有影响其他地方的问题

截图&代码:

add() { if (typeof this.addBefore === 'function') this.addBefore() // 默认新增空数据 let rowNum = this.addDefaultRowNum if (typeof rowNum !== 'number') { rowNum = 1 console.warn('由于你没有在 data 中定义 addDefaultRowNum 或 addDefaultRowNum 不是数字,所以默认添加一条空数据,如果不想默认添加空数据,请将定义 addDefaultRowNum 为 0') } this.eachAllTable((item) => { //update-begin-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349 if (rowNum !== 0) { setTimeout(() => { for (let i = 0; i < rowNum; i++) { item.addRows() } }, 30) } //update-end-author:taoyan date:20210315 for: 一对多jvex 默认几行不好使了 LOWCOD-1349 }) if (typeof this.addAfter === 'function') this.addAfter(this.model) this.edit(this.model) },

友情提示(为了提高issue处理效率):

  • 未按格式要求发帖,会被直接删掉;
  • 描述过于简单或模糊,导致无法处理的,会被直接删掉;
  • 请自己初判问题描述是否清楚,是否方便我们调查处理;
  • 针对问题请说明是Online在线功能(需说明用的主题模板),还是生成的代码功能;
@Haowensheng
Copy link
Author

image

@zhangdaiscott
Copy link
Member

jl

@sjlei
Copy link

sjlei commented Oct 10, 2022

问题已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants