Skip to content
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

n-modal 新增 max-height 属性 #6759

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zhengdaonian
Copy link
Contributor

@zhengdaonian zhengdaonian commented Feb 18, 2025

不传maxheight,按原来的外部滚动条逻辑!
传了maxheight,替换滚动条成div
dialog增加flex布局
如果maxheight传string类型最后一位是%,套一层VResizeObserver计算body-wrapper的高度(我试了一下120px%,也按120%计算了,挺正常)
保留外部的scrollbar

close #4848

Copy link

vercel bot commented Feb 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
naive-ui ❌ Failed (Inspect) Feb 20, 2025 2:44am

@jahnli
Copy link
Collaborator

jahnli commented Feb 19, 2025

因为没办法预览,如果加上 max-height 滚动条样式还是原来的 NScrollBar 吗?

@zhengdaonian
Copy link
Contributor Author

zhengdaonian commented Feb 19, 2025

传了max-height,外层那个scroll会被替换成div,不然不好兼容传%的。

不传就还是原来外层scroll的逻辑,兼容以前没传的

@zhengdaonian
Copy link
Contributor Author

image

image

@zhengdaonian
Copy link
Contributor Author

@jahnli 这么写不可以吗,外层就是要scrollbar吗?

@jahnli
Copy link
Collaborator

jahnli commented Feb 19, 2025

@jahnli 这么写不可以吗,外层就是要scrollbar吗?

个人觉得如果能实现 scrollbar 是最好的,不然感觉是个 break change ,用户有一些 scrollbar 的属性或者发现样式变了

@zhengdaonian
Copy link
Contributor Author

嗯,那我再想想,用户传%的话滚动条不好处理。我晚点对传%的处理一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

n-modal 支持设置最高高度,超出在modal区域内滚动
2 participants