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

amis-editor-demo编辑器无法监听到页面数据的实时变化 #10866

Open
amlxamlx opened this issue Sep 3, 2024 · 2 comments
Open

amis-editor-demo编辑器无法监听到页面数据的实时变化 #10866

amlxamlx opened this issue Sep 3, 2024 · 2 comments

Comments

@amlxamlx
Copy link

amlxamlx commented Sep 3, 2024

描述问题:

amis-editor-demo编辑器无法监听到页面数据的实时变化,能够监听到,但获取到的一直都是旧数据

请用一段清晰简洁的文字描述问题是什么...

截图或视频:

image

可以的话,尽可能提供截图或视频来补充描述你的问题...

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    sdknpm其他...
    amis-editor-demo编辑器
  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.7.0
  3. 粘贴有问题的完整 amis schema 代码:
code here...
  reaction(
        () => getSnapshot(self.pages),
        pages => {
          if (timer) clearTimeout(timer)
          timer = setTimeout(() => {
            watchPage(pages)
          }, time);
        },
      );
  1. 操作步骤
    请简单描述一下复现的操作步骤...
    修改页面,会监听到但数据不是最新的
@amlxamlx
Copy link
Author

amlxamlx commented Sep 3, 2024

image
示例图

@amlxamlx
Copy link
Author

amlxamlx commented Sep 6, 2024

仍然没有找到问题出处,使用reaction确实监听不到了最新数据,但是找到了对应的解决方法。改变监听规则,不再是reaction监听所有页面的内容变化,而是监听当前页面内容schema,只要变化就请求更新当前页面的最新数据

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant