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

联动无法使用 #36

Open
MelodyLLL opened this issue May 10, 2022 · 10 comments
Open

联动无法使用 #36

MelodyLLL opened this issue May 10, 2022 · 10 comments

Comments

@MelodyLLL
Copy link

就算打开不填数据也提示格式有误

@rayle2
Copy link

rayle2 commented Jan 11, 2023

同样问题

@thpngj
Copy link

thpngj commented Mar 17, 2023

@xaboy 编辑数据的 Struct 组件的确有问题;

  1. 第一次写入数据后点 确定也保存了,但第二次打开后什么不都改,再点确定就会提示格式错误,只好把内容全部删掉,重新来一次;
    1. 自定义组件,想用这个 Struct 编辑器 来编辑 on 属性,就写了很简单的 alert(123)点确定后 再次打开编辑器,这个编辑器把我写的内容全都改了~ 我自己写的 alert(123) 都不知道弄哪儿了~!
      WX20230317-165103@2x
      WX20230317-165130@2x

@xaboy
Copy link
Owner

xaboy commented Mar 17, 2023

那个版本 @thpngj

@thpngj
Copy link

thpngj commented Mar 17, 2023

@xaboy vue2 ,vue3 都有相同的问题,你有空可以看一下 文档上面的示例~http://form-create.com/v3/designer

@xaboy
Copy link
Owner

xaboy commented Mar 17, 2023

请问这个问题如何复现, 这边测试了下,没有复现 @thpngj

@thpngj
Copy link

thpngj commented Mar 17, 2023

WX20230317-174227@2x
随便找个组件,然后点击 联动数据 - 编辑数据,把数据输入后点确定,正常,然后再次点击 联动数据 - 编辑数据 ,什么都不改动,就点击确定 就会提示 格式错误
WX20230317-174252@2x

这个问题一直都会有~

第二个问题是: 我自定义一个按钮组件,想编辑 这个组件的 on 属性,需要用到这个 Struct 组件 编辑器,但我 编辑好数据之后,点击确定保存后 ,再次点击编辑, 弹出编辑框后,显示的内容却不是 我之前输入的内容 … 这一块儿也不知道该如何处理~
@xaboy

@thpngj
Copy link

thpngj commented Mar 17, 2023

@xaboy 格式有误的问题找到原因了,编辑框确定后对数据进行了转换(toJson),把格式给转换错了, 但目前即不知道如何解决;
WX20230317-232634@2x
WX20230317-233207@2x

第二个问题的原因也找到了,但不知道该如何解决,我在编辑框内输入的 { click:function(a){} } 转换成了一堆不认识的代码是因为,我在 组件的属性上开启了事件注入inject:true ,所以点击确定保存后 经过 toJson 转换成了一堆并不是我写入的内容
WX20230317-234905@2x
WX20230317-235122@2x
以上两个问题 应该都是 代码编辑框保存 toJSON 转换的问题~

@thpngj
Copy link

thpngj commented Mar 18, 2023

@xaboy 以上两个问题已经解决, 第1个: 编辑后 第一次可以正常保存, 然后再打开,就会提示出错,的确是 tojson 转换的问题,所以 在编辑框内输入的 function 方法 或是 对象 不要用 es6 那种简写,老老实实 正常 es5 老写法, 然后就是 点击确定保存 的时候 先让 err 的状态为 false ,之后再去做 验证 是否正确,因为 没有详细去找如何 监听编辑框的 change事件,所以 暂时 改了 点击保存的 验证 , 第2个问题:自定义 on 属性, 是看到 _control 属性(数据联动)的启发, 我也弄了个 _on 事件, 之后再处理 相关 rule 赋值问题~ 折腾了个通宵 加一上午 ,汗~

@xaboy
Copy link
Owner

xaboy commented Mar 18, 2023

感谢反馈 @thpngj

  1. tojson和err状态的问题,下个版本修复.
  2. 第二个用_on来配置这个思路是正确的, 实现后欢迎PR

xaboy added a commit that referenced this issue Mar 18, 2023
@xaboy
Copy link
Owner

xaboy commented Mar 20, 2023

1.0.10版本已修复 @thpngj

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

4 participants