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: watch open logic lost after build #3421

Merged
merged 2 commits into from
Dec 16, 2023

Conversation

xachary
Copy link

@xachary xachary commented Dec 15, 2023

General

使用 Drawer 的时候,在组件内部使用 getOpen 获取是否打开状态,发现 build 之后没有生效。对比build前后代码,关键逻辑丢失,如下:
S0Ip7PTpt9
不考虑 build 配置,微调判断可以避免这个问题。

  • Pull request template structure not broken

Type

ℹ️ What types of changes does your code introduce?

👉 Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

👉 Put an x in the boxes that apply.

  • My code follows the style guidelines of this project
  • Is the code format correct
  • Is the git submission information standard?
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@wangjue666
Copy link
Collaborator

惊呆了这是啥原理

@xachary
Copy link
Author

xachary commented Dec 16, 2023

image

@xachary
Copy link
Author

xachary commented Dec 16, 2023

pnpm preview

打开 Drawer

image

@xachary
Copy link
Author

xachary commented Dec 16, 2023

image

貌似也可以解决,可能就是这样原因,&& 后面带了个 ?.()

@wangjue666
Copy link
Collaborator

image

貌似也可以解决,可能就是这样原因,&& 后面带了个 ?.()

这个中,改成这样 代码也好阅读

@wangjue666
Copy link
Collaborator

我猜测vite 是由于开发环境和打包环境代码编译工具不一样, 导致Rollup打包有问题, 或许要考虑升级vite版本了,现在最新版本已经是5.x了

@xachary
Copy link
Author

xachary commented Dec 16, 2023

@wangjue666

我猜测vite 是由于开发环境和打包环境代码编译工具不一样, 导致Rollup打包有问题, 或许要考虑升级vite版本了,现在最新版本已经是5.x了

行,按上面代码改。

vite5,期待升级。

如无需在此时修改,可以close。

@likui628 likui628 merged commit 089a989 into vbenjs:main Dec 16, 2023
2 checks passed
WitMiao pushed a commit to WitMiao/vue-vben-admin that referenced this pull request Dec 17, 2023
* fix: watch open logic lost after build

* fix: drawer for better understand
chen178173956 pushed a commit to chen178173956/vue-vben-admin that referenced this pull request Dec 20, 2023
* fix: watch open logic lost after build

* fix: drawer for better understand
@xachary xachary mentioned this pull request Dec 25, 2023
16 tasks
@xachary xachary deleted the fix-drawer-build-logic-lost branch December 28, 2023 09:35
@vbenjs vbenjs locked and limited conversation to collaborators Aug 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants