-
-
Notifications
You must be signed in to change notification settings - Fork 168
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: 🐛 修复LockScroll后切换页面无法滚动 #478
Conversation
✅ Closes: #473
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更改增强了 Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
✅ Deploy Preview for wot-design-uni ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
src/uni_modules/wot-design-uni/components/composables/useLockScroll.ts (1)
22-24
: 确保destroy
函数逻辑正确
destroy
函数在组件停用或卸载时调用,确保滚动锁定状态正确释放。逻辑上没有问题,但建议在注释中说明其用途,以提高代码可读性。+ // 在组件停用或卸载时调用,确保滚动锁定状态正确释放 const destroy = () => { shouldLock() && unlock() }
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/uni_modules/wot-design-uni/components/composables/useLockScroll.ts (2 hunks)
Additional comments not posted (2)
src/uni_modules/wot-design-uni/components/composables/useLockScroll.ts (2)
30-31
: 验证生命周期钩子的使用新增的
onDeactivated
和onBeforeUnmount
生命周期钩子确保在组件停用或卸载时调用destroy
函数。此改动符合预期,确保资源管理得当。
32-34
: 确保返回正确的方法返回的
lock
和unlock
方法确保了外部调用的灵活性。代码逻辑清晰,符合预期。
✅ Closes: #473
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
#473
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
useLockScroll
的功能,确保在组件卸载或停用时适当释放滚动锁定。