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

grid 和 space 联合使用导致的样式问题 #3053

Closed
lisiur opened this issue Jun 7, 2022 · 4 comments
Closed

grid 和 space 联合使用导致的样式问题 #3053

lisiur opened this issue Jun 7, 2022 · 4 comments

Comments

@lisiur
Copy link
Contributor

lisiur commented Jun 7, 2022

TuSimple/naive-ui version (版本)

2.30.2

Vue version (Vue 版本)

3.2.37

Browser and its version (浏览器及其版本)

Edge(102.0.1245.33)

System and its version (系统及其版本)

Windows11

Node version (Node 版本)

Reappearance link (重现链接)

https://codesandbox.io/s/twilight-dawn-92cokm?file=/src/App.vue

Reappearance steps (重现步骤)

在grid item里使用 space 垂直居中对齐子元素

Expected results (期望的结果)

子元素是垂直居中的

Actual results (实际的结果)

space 会向上偏移,导致子元素在 grid item中 没有居中对齐

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label Jun 7, 2022
@07akioni
Copy link
Collaborator

07akioni commented Jun 8, 2022

应该是负 margin 导致的

@07akioni
Copy link
Collaborator

07akioni commented Jun 8, 2022

只能在支持 gap 的浏览器里避免这点

@07akioni 07akioni removed the untriaged need to sort label Jun 8, 2022
@lisiur
Copy link
Contributor Author

lisiur commented Jun 9, 2022

感谢 @07akioni 大佬这么迅速的修复。我有个疑惑,这里的负 margin 是为了解决什么问题呢,我尝试着去掉负 margin 好像也没有什么问题呢,希望大佬百忙中能抽空帮我解惑下,多谢多谢~

@07akioni
Copy link
Collaborator

感谢 @07akioni 大佬这么迅速的修复。我有个疑惑,这里的负 margin 是为了解决什么问题呢,我尝试着去掉负 margin 好像也没有什么问题呢,希望大佬百忙中能抽空帮我解惑下,多谢多谢~

具体我也记不太清了,反正和为了把 tags 正的 margin 补回来相关

在一些极限场景是会出问题的

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

No branches or pull requests

2 participants