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

fix: known drawer issues #531

Merged
merged 2 commits into from
Dec 14, 2023
Merged

fix: known drawer issues #531

merged 2 commits into from
Dec 14, 2023

Conversation

igauch
Copy link
Contributor

@igauch igauch commented Dec 14, 2023

  1. 使用服务方式不会应用组件设定的默认值
    a. 之前是使用 Object.assign(compnent, option),现在变成服务是唯一打开抽屉方式,组件只是服务的另一个形式,顺序颠倒了,是先组件后服务。所以应该把默认值写到service里,把组件的assign给服务
  2. 使用服务的方式关闭后再打开内容还是之前的,不会变,哪怕数据变了
    a. 因为之前使用服务的方式关闭会销毁实例,而组件形式因为有两个overlay,销毁的只是服务的overlay,所以aui-drawer组件本身的overlay并没有被销毁,也就是传入的组件并没有被销毁;
    b. 之前两种形式的这种差异没有被清晰的意识到,然后受家忍提出“需要缓存”的影响,就改成关闭不销毁了,包括使用服务的方式。后面在验证的时候也只是验证表单状态是否被保留,而没有验证是否可以正常更新内容导致出现问题
    c. 新增 disposeWhenHide 配置,默认值是true,也就是关闭即销毁,但组件里默认是false,与之前的行为保持一致

Copy link

changeset-bot bot commented Dec 14, 2023

🦋 Changeset detected

Latest commit: 811149b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yangxiaolang
Copy link
Collaborator

没必要去掉组件内的默认值吧,我看有的地方没通过 Service 来使用抽屉

@igauch
Copy link
Contributor Author

igauch commented Dec 14, 2023

没必要去掉组件内的默认值吧,我看有的地方没通过 Service 来使用抽屉

组件方式最终也是通过service实现的

@yangxiaolang
Copy link
Collaborator

没必要去掉组件内的默认值吧,我看有的地方没通过 Service 来使用抽屉

组件方式最终也是通过service实现的

ok, 我没问题了

@JounQin JounQin changed the title fix: drawer default option fix: known drawer issuwse Dec 14, 2023
@JounQin JounQin changed the title fix: known drawer issuwse fix: known drawer issues Dec 14, 2023
@JounQin JounQin merged commit 780dfb2 into master Dec 14, 2023
8 checks passed
@JounQin JounQin deleted the fix/drawer branch December 14, 2023 07:36
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.

3 participants