We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使用 setValue 为组件赋值,如果值的类型为 json 对象,并且对象的属性包含了 ".",则最后被赋值的内容被错误地解析。例如:对象 {'.abc': 123},赋值到组件后,组件的实际值为 {'': {abc: 123}}。属性 ".abc" ,被解析为两层对象。
你是如何使用 amis 的? react环境 amis:6.5.0 版本
amis 版本是什么?请先在最新 beta 版本测试问题是否存在
粘贴有问题的完整 amis schema 代码:
amis schema
{ "type": "page", "title": "test", "body": [ { "type": "editor", "label": "代码编辑器", "name": "editor", "id": "u:editor", "value": "", "language": "javascript" } ], "regions": [ "body", "header" ], "id": "u:page", "pullRefresh": { "disabled": true }, "onEvent": { "init": { "weight": 0, "actions": [ { "ignoreError": false, "actionType": "setValue", "args": { "value": { ".a": 1 } }, "componentId": "u:editor" } ] } } }
The text was updated successfully, but these errors were encountered:
含 . 的key, 如果要在数据域中不进行对象转换, 貌似只有替换方法, 否则会影响本来的对象解析
.
.abc => ___abc
Sorry, something went wrong.
含 . 的key, 如果要在数据域中不进行对象转换, 貌似只有替换方法, 否则会影响本来的对象解析 .abc => ___abc
谢谢回复。 又发现相关的隐蔽的问题,字符串中的 "${...}" 被自动计算,也需要进行转码才能解决
// 自定义脚本 const a = "${1+2}"; // 不想被计算 doAction({ actionType: 'broadcast', "args": { "eventName": "OK" }, "data": { "a": a } })
广播出来的数据:{a: 3},如果需要广播传递: {a: "${1 + 2}"},也只能转码
No branches or pull requests
描述问题:
使用 setValue 为组件赋值,如果值的类型为 json 对象,并且对象的属性包含了 ".",则最后被赋值的内容被错误地解析。例如:对象 {'.abc': 123},赋值到组件后,组件的实际值为 {'': {abc: 123}}。属性 ".abc" ,被解析为两层对象。
截图或视频:
如何复现(请务必完整填写下面内容):
你是如何使用 amis 的?
react环境
amis:6.5.0 版本
amis 版本是什么?请先在最新 beta 版本测试问题是否存在
粘贴有问题的完整
amis schema
代码:请简单描述一下复现的操作步骤...
The text was updated successfully, but these errors were encountered: