Skip to content

请教 <n-message> container 的高度设置的原因 #2832

Closed Answered by 07akioni
zjlovezj asked this question in Q&A
Discussion options

You must be logged in to vote

在源码中,

https://github.com/TuSimple/naive-ui/blob/cbc2940bd84ea74782b900d2efb2d5cbadedbe1a/src/message/src/styles/index.cssr.ts#L113

这行代码在 Chrome/58.0.3029.110 的环境中导致多个message会重叠在一起。

按说 div.n-message-container 的 height 默认就是 auto,这应该能满足需求了,在 Chrome 58 和 Chrome 100 中也表现正常。

所以为什么要设置 height: 0 ?

因为如果是 auto 的话会因为太宽盖住其他元素。

Chrome/58.0.3029.110 是明确不会支持的版本,不到 70 的肯定会有各种各样的问题。

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zjlovezj
Comment options

@07akioni
Comment options

Answer selected by zjlovezj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants