Skip to content

fix(StyleContext): fix style cache duplicate creation #7029

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

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

aibayanyu20
Copy link
Member

fix: #7023

@aibayanyu20 aibayanyu20 changed the title fix(StyleContext): fix style cache loaded repeat fix(StyleContext): fix style cache duplicate creation Oct 17, 2023
const instance = getCurrentInstance();
let cache: CacheEntity;
if (instance && instance.appContext) {
const globalCache = instance.appContext?.config?.globalProperties?.__ANTDV_CSSINJS_CACHE__;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用挂实例上吧,直接扔最外面就可以

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在第113的部分最外面有一个,不这样处理的话会不会影响到 #6912 这个issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有道理

@aibayanyu20
Copy link
Member Author

image
image

@tangjinzhou 刚刚本地跑了一下,如果是他这种情况的话,还是会导致其他的实例无法正常的挂上样式

const instance = getCurrentInstance();
let cache: CacheEntity;
if (instance && instance.appContext) {
const globalCache = instance.appContext?.config?.globalProperties?.__ANTDV_CSSINJS_CACHE__;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有道理

@tangjinzhou tangjinzhou merged commit 61e5746 into vueComponent:main Oct 17, 2023
@tangjinzhou
Copy link
Member

挂实例上就没有问了吗

@aibayanyu20
Copy link
Member Author

挂实例上就没有问了吗

是的每一个vue的实例单独分配一个cache就好使

@tangjinzhou
Copy link
Member

那就酱紫

@aibayanyu20 aibayanyu20 deleted the fix-style-cache branch January 28, 2024 23:41
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 28, 2025
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.

在节点数量较多的情况下页面很卡
2 participants