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

update:修复表格初始化后有筛选条件,data-id从1开始递增的问题 #136

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

WindowsXP-XP
Copy link

@WindowsXP-XP WindowsXP-XP commented Feb 28, 2021

若后台保存筛选条件,将筛选条件传回前端,对组件进行初始化时将筛选条件设置进去,则点击编辑筛选条件 --> 添加条件 时li标签上的data-id是从1开始计算的,这样就不是全局唯一了。修改后在表格第一次加载时若已经存在筛选条件,则从该筛选条件数据中id的最大值+1作为新增筛选条件行的li标签的data-id,从而实现已经存在筛选条件时也能全局唯一id,而不是从1开始进行计算。因为maxId默认值是1

若后台保存筛选条件,将筛选条件传回前端对组件进行初始化,则点击编辑筛选条件 --> 添加条件 时li标签上的data-id是从1开始计算的,这样就不是全局唯一了。修改后在表格第一次加载时若已经存在筛选条件,则从该筛选条件数据中id的最大值+1作为新增筛选条件行的li标签的data-id,从而实现已经存在筛选条件时也能全局唯一id,而不是从1开始进行计算。因为maxId默认值是1
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

Successfully merging this pull request may close these issues.

1 participant