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

开发一个新组件,在新组件内部需要修改formConfig的某个属性,这个是使用什么方法可以完成 #578

Closed
kingjinkin opened this issue Mar 10, 2024 · 8 comments
Labels
question Further information is requested

Comments

@kingjinkin
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@jia000
Copy link
Collaborator

jia000 commented Mar 11, 2024

具体描述一下场景,要实现什么功能,在什么时机需要改?

@jia000
Copy link
Collaborator

jia000 commented Mar 11, 2024

是跟这个issue 一样的需求?#567

@kingjinkin
Copy link
Author

我想开发一个文本编辑器组件,该组件可以双击就可以编辑,该组件获取到的文本字符串怎么传递到该组件的form表单中

@jia000
Copy link
Collaborator

jia000 commented Mar 13, 2024

调用editorService.update把数据更新就可以了,更新的数据要包含id

editorService.update({ id: xxx, text: xxx })

@jia000 jia000 added the question Further information is requested label Mar 21, 2024
@microNewLife
Copy link

请问组件内部如何获取到editorService呢?看了下示例,有注入app,但是没有各类service的注入

@Little-LittleProgrammer
Copy link
Contributor

Little-LittleProgrammer commented Apr 5, 2024

请问组件内部如何获取到editorService呢?看了下示例,有注入app,但是没有各类service的注入

如果是ui组件的话, 内部是无法调用service, service是编辑器专属的, runtime无法使用, 否则最终的h5页面会有很多的冗余代码
应该是这样的😀

@microNewLife
Copy link

请问组件内部如何获取到editorService呢?看了下示例,有注入app,但是没有各类service的注入

如果是ui组件的话, 内部是无法调用service, service是编辑器专属的, runtime无法使用, 否则最终的h5页面会有很多的冗余代码 应该是这样的😀

明白了,那我组件内如何修改对应props.config对象的某个值呢?比如props.config.foo,右侧表单输入的是‘bar’,组件内部想修改成'ugly',找了很久的文档都没找到,看代码也没有看到。这个需求有办法解决吗?

@jia000
Copy link
Collaborator

jia000 commented Sep 5, 2024

请问组件内部如何获取到editorService呢?看了下示例,有注入app,但是没有各类service的注入

如果是ui组件的话, 内部是无法调用service, service是编辑器专属的, runtime无法使用, 否则最终的h5页面会有很多的冗余代码 应该是这样的😀

明白了,那我组件内如何修改对应props.config对象的某个值呢?比如props.config.foo,右侧表单输入的是‘bar’,组件内部想修改成'ugly',找了很久的文档都没找到,看代码也没有看到。这个需求有办法解决吗?

组件内是不允许修改config的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants