Conversation
Member
|
|
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.
背景
当 Vue 中的条件具名 slot 从空变为有内容时,
omi-vueify会更新 Web Component 的 light DOM,但 Omi 组件可能仍保留初始化时的props.children。依赖 slot 内容的组件 UI 因此保持旧状态,直到下一次 Omi 更新才显示。修复
onUpdated钩子中等待 DOM patch 完成;props.children缓存,并调用 Omi 的公开update()方法重新读取 light-DOM children;update()方法的元素保持 no-op;验证
npx jest test/vueify.test.jsx --runInBand --testNamePattern='slots':4/4 passed;npm run build(Vite + TypeScript):通过;npx eslint --config ../omi/.eslintrc.cjs --rule 'semi: off' ../omi-vueify/src/index.ts ../omi-vueify/test/vueify.test.jsx:通过;git diff --check:通过;Fixes #997
AI assistance disclosure
Codex assisted with investigation and test drafting. I reviewed the complete diff and verified the behavior and build locally.