Comments (2)
这个问题发生在 ArrayField 往数组中间insert的时候,向数组尾部添加不会触发该问题。
该 issue 中的 case 在 ArrayField 执行 spliceArrayState
方法的时候,分别发生以下情况:
- 第一次 copy, 尾部插入,元素不需要 move,插入的 field 对应 address 由
Form.createField()
生成。此时Path 对象由FormPath.parse('array').concat(1)
生成,因此segment的值为['array', 1]
- 第二次 copy, 中间插入,触发
moveIndex
方法生成 fieldPatch。fieldPatch 使用 identifier 作为 address ,identifier为字符串"array.2"
,丢失了数组下标的类型,因此 segment 的值为['array', '2']
。
formily/packages/core/src/shared/internals.ts
Lines 399 to 407 in 4dc50bc
@janryWang 我尝试将 moveIndex 的返回改成
FormPath.parse(preStr).concat(index)
, 但是会破坏 interface INodePatch
的声明,INodePath 中的address 都是字符串类型,白总看看这个能改成Pattern 类型吗,或者还是考虑别的解决办法?from formily.
Is there any update on this issue?
from formily.
Related Issues (20)
- [Feature Request] vite中配置vite-plugin-imp按需引入,未引入的组件,但有大量的scss引入
- [Feature Request] 希望formily设计器加入arrayitems拖拽组件
- [Bug Report] ArrayItems如何给初始项,假如给value=[{name: ""}],这样后组件是没办法写placeholder或者其他属性的吧
- [Bug Report] symbol value not show in devtool HOT 1
- [Bug Report] FormTab not render inactive tab HOT 2
- Documentation for React native support HOT 1
- [Bug Report] 【feedbackTextError】当有自定义validator + 默认的validator时提示文案出错 HOT 1
- [Bug Report] ArrayField删除行时,多次删除同一行,由于field顺序导致对字段的操作顺序不对
- [Feature Request] 不支持JSON SCHEMA $ref的引用语义吗
- [Bug Report] ArrayTable最后一行校验浮动层被遮挡
- [Bug Report] formily/element-plus 官方示例 FormDrawer组件, 打开表单,未填信息触发校验提示,补全数据后提交,无法回调then方法
- [Bug Report] 在Vue2中使用@formily/element有问题 HOT 4
- <Fied/>的x-component-props={{ labelInValue: true }}的时候,只读模式为NAN,版本formily1 HOT 1
- [Bug Report] <Field type="string" enum={intersectionData} title="people" name="people" // x-component='select' x-component-props={{ labelInValue: true }} /> 版本:"@uform/antd": "^1.0.5",
- [Feature Request] JSON Schema example for tabs and steps.
- [Bug Report] Antd-v5 ArrayTable组件中的过滤功能异常 HOT 1
- [Bug Report] 重置后$record和值的问题,感觉异步了? HOT 1
- [Bug Report] ArrayField根据条件渲染不同的子组件(A、B),添加B,删除B,再添加A,报错,Cannot read properties of undefined (reading 'onMount') HOT 1
- [Bug Report] element-plus 组件设置中文失效
- [Bug Report] formily/semi中formItem组件配置tooltip会被截断 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formily.