-
Notifications
You must be signed in to change notification settings - Fork 748
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
feat(ArrayField): enhance add method to support optional index-based insertion issue#2544 #2628
base: main
Are you sure you want to change the base?
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 62565be:
|
@pointhalo 麻烦您了 请问这样解决这个issue可以嘛 希望得到您的批评指点~ |
抱歉,最近事情比较多。处理速度没跟上,预计下周整体看一下
|
好的,我看一下哈 |
7d676ed
to
3e5319d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增的测试用例通过,但arrayfield.test.js的一项遇到了问题,我会排查一下错误根源
之前的做法是希望用户使用add时默认在最后一行插入新行,用户可以传入索引在任意位置插入,未传入索引,默认插在最后一行。由于我的测试代码都是箭头函数调用,没有出现问题。之前的demo出现了如下的问题: 调整add方法后,支持传入索引
但是这样修改之后,用户用
箭头函数的方式调用,表现正常。
的调用方法了 |
|
经过debug发现当onclick={add}时的index并不是undifined,而是 |
…o feat-shabix-2544
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
Fixes #
Changelog
🇨🇳 Chinese
-feat: 根据 issue#2544的建议,针对arrayfiled组件add只能始终添加到最后一个位置,我阅读代码后修改了一下add方法,提供了一个可选的index来给与使用者添加新项位置的可选性,并添加了一个storybook测试项进行了一些测试。
🇺🇸 English
Checklist
Other
Additional information