feat(layout): support mouse wheel horizontal scroll on global tab - #933
Merged
Merged
Conversation
Azir-11
requested changes
Jul 7, 2026
Azir-11
left a comment
Member
There was a problem hiding this comment.
感谢pr,初步来看有点小问题需要修改:
- commit 需要通过 pnpm commit 提交符合规范的 msg 格式
- msg 正文以及注释需要遵循项目规范使用英文
- 对 "WHEEL_SPEED_RATIO" 这类的魔法常量可以放到全局的常量文件里面
lvlvkeeper
force-pushed
the
feat/tab-wheel-scroll
branch
from
July 9, 2026 00:56
fd7f907 to
6d38ea4
Compare
lvlvkeeper
force-pushed
the
feat/tab-wheel-scroll
branch
2 times, most recently
from
July 9, 2026 01:23
1e5fe79 to
40f93c5
Compare
Contributor
Author
|
好的,已按照要求修改并重新提交PR |
Member
对于WHEEL_SPEED_RATIO 其实我的意思是放到constants文件夹里面的,如果说你想把它做到主题配置里面,那么就需要在“主题配置”这个 drawer 里面增加配置的支持。其实我是比较偏向于不做配置或者写到constants里面的 |
lvlvkeeper
force-pushed
the
feat/tab-wheel-scroll
branch
from
July 10, 2026 09:04
40f93c5 to
1e5fe79
Compare
Azir-11
approved these changes
Jul 10, 2026
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.
背景
当标签页数量较多时,现有标签栏只能通过点住某个标签后拖动才能查看其他标签,操作不便。用户期望在鼠标进入标签栏区域时,可以直接用鼠标滚轮让标签左右滑动,同时保留现有所有功能(拖拽、中键关闭、右键菜单等)。
改动内容
在
src/layouts/modules/global-tab/index.vue中新增滚轮横向滑动支持:handleWheel函数:监听wheel事件,将滚轮的纵向deltaY转换为 BetterScroll 实例的横向scrollBy偏移WHEEL_SPEED_RATIO,便于后续按手感调整(< 1 减慢,> 1 加快)bsWrapper容器上绑定@wheel="handleWheel"兼容性保障
bs.maxScrollX === 0,横向无滚动空间)时不拦截事件,避免影响页面正常纵向滚动验证
pnpm typecheck通过(0 error)pnpm lint通过(0 warnings, 0 errors)截图 / 录屏