ascoders / gaea-editor

Design websites in your browser. A smart web editor!
https://gaeajs.github.io/gaea-site/
MIT License
1.34k stars 222 forks source link

修正 object 类型 realField 路径 bug #40

Closed SturdyCat closed 5 years ago

SturdyCat commented 5 years ago

object 内部包裹空间会自行追加 realField

realField: this.props.realField + '.' + editor.field

以上代码会造成字段名重复追加

zongwei007 commented 5 years ago

这个问题有什么进展吗?

ascoders commented 5 years ago

这个是修复什么问题,能具体描述一下吗?为什么把 editor.field 干掉

zongwei007 commented 5 years ago

对于 object 类型的对象,在编辑数值后,最终传入组件 props 的数据结构与预期不符。例如:

{
  type: 'object',
  text: '更多',
  field: 'more',
  data: [
    {
      field: 'text',
      type: 'string',
      text: '文本',
    },
  ],
}

编辑 文本 字段时,预期得到的数据结构是 { more: { text: "foo" } },但目前得到的是{ more: { text: { text: "foo"} } }field 被重复了。