We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
qiankun目前支持微应用使用appendChild、insertBefore动态添加样式表和脚本元素。并劫持了这两个方法。但是对于insertAdjacentElement方法没有劫持。
而Vite下处理import "xxxx.css"的时候,它最终会使用insertAdjacentElement方法添加动态样式表。
import "xxxx.css"
let lastInsertedStyle; function updateStyle(id, content) { let style = sheetsMap.get(id); if (!style) { //... if (!lastInsertedStyle) { document.head.appendChild(style); //... } else { lastInsertedStyle.insertAdjacentElement("afterend", style); } lastInsertedStyle = style; }
这就导致了vite应用里的样式,在应用卸载后再次加载时,无法被rebuild()
在patchHTMLDynamicAppendPrototypeFunctions方法里,添加** HTMLHeadElement.prototype.insertAdjacentElement劫持的相关代码,和appendChild**其实是一样的。
辛苦各位开发大姥!!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
背景
qiankun目前支持微应用使用appendChild、insertBefore动态添加样式表和脚本元素。并劫持了这两个方法。但是对于insertAdjacentElement方法没有劫持。
而Vite下处理
import "xxxx.css"
的时候,它最终会使用insertAdjacentElement方法添加动态样式表。这就导致了vite应用里的样式,在应用卸载后再次加载时,无法被rebuild()
建议
在patchHTMLDynamicAppendPrototypeFunctions方法里,添加** HTMLHeadElement.prototype.insertAdjacentElement劫持的相关代码,和appendChild**其实是一样的。
辛苦各位开发大姥!!
The text was updated successfully, but these errors were encountered: