Skip to content

feat: Support storeBindingsBehavior for the Page constructor #65

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

Closed

Conversation

a13837811459
Copy link

this feature #64

@a13837811459
Copy link
Author

在Page构造器中,小程序框架会对其中的options进行deep copy,复制后的对象中,getter/setter会被处理掉,导致store中getter/setter消失,当store中的值被修改后,无法同步给Paga

@LastLeaf
Copy link
Member

感谢!

但是需要加一个测试用例。

@LastLeaf LastLeaf self-assigned this Apr 21, 2025
@a13837811459
Copy link
Author

翻了一下glass-easel的文档,好像不能模拟Page constructor吗?
image

@LastLeaf
Copy link
Member

可以模拟的。

f(env.Component, env)

这个地方的 env 有 Page 构造器。具体接口 看看这里

@a13837811459
Copy link
Author

似乎....在glass-easel中,Page构造函数有点问题,我不太确定是否是我写的问题,data中数据可以正常渲染,但是onLoad不会执行
image
image

@LastLeaf
Copy link
Member

似乎....在glass-easel中,Page构造函数有点问题,我不太确定是否是我写的问题,data中数据可以正常渲染,但是onLoad不会执行 image image

onLoad (以及所有 on 开头的 methods 都是小程序接口),不是 glass-easel 接口,所以是没有的。

@LastLeaf
Copy link
Member

我自己试了下,发现使用 glass-easel 无法复现这个问题。所以应该还是受到小程序环境的一些处理影响了。

@LastLeaf
Copy link
Member

#66 中包含了这个问题的修复。

@LastLeaf LastLeaf closed this May 26, 2025
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

Successfully merging this pull request may close these issues.

2 participants