fix: 修复日历组件空白渲染问题 - #4
Open
XRYua wants to merge 3 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
document.getElementById和未隔离的全局执行上下文导致实例间互相干扰。Description
document.currentScript.previousElementSibling定位当前组件根节点。document.getElementById(...)查询替换为基于当前根节点的widgetRoot.querySelector(...),避免重复id时命中错误实例。src/components/widget/Calendar.astro(局部 DOM 查询与脚本作用域调整)。Testing
pnpm -s check(失败,原因为仓库中已存在的src/layouts/Layout.astro类型错误,与本次日历改动无关)。pnpm dev --host 0.0.0.0 --port 4321成功运行并对外可访问。Codex Task