mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
fix(space): inner display: grid
element breaks item height, closes #546
This commit is contained in:
parent
f968e1c179
commit
18c88ae655
@ -8,6 +8,10 @@
|
||||
- `n-checkbox-group` add `min` and `max` prop.
|
||||
- `n-mention` add `empty` slot.
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix `n-space`'s inner `display: grid` element breaks item height, closes `https://github.com/TuSimple/naive-ui/issues/546`.
|
||||
|
||||
## 2.15.5 (2021-07-16)
|
||||
|
||||
### Feats
|
||||
|
@ -8,6 +8,10 @@
|
||||
- `n-checkbox-group` 新增 `min` 和 `max` 属性
|
||||
- `n-mention` 新增 `empty` slot
|
||||
|
||||
### Fixes
|
||||
|
||||
- 修复 `n-space` 中 `display: grid` 的元素显示不正确,关闭 `https://github.com/TuSimple/naive-ui/issues/546`
|
||||
|
||||
## 2.15.5 (2021-07-16)
|
||||
|
||||
### Feats
|
||||
|
28
src/space/demos/zhCN/grid-debug.demo.md
Normal file
28
src/space/demos/zhCN/grid-debug.demo.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Grid Debug
|
||||
|
||||
```html
|
||||
<n-space vertical>
|
||||
<div class="grid-list">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
<div class="grid-list">
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
<div class="item"></div>
|
||||
</div>
|
||||
</n-space>
|
||||
```
|
||||
|
||||
```css
|
||||
.grid-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, 100px);
|
||||
gap: 20px;
|
||||
}
|
||||
.item {
|
||||
background-color: tomato;
|
||||
height: 100px;
|
||||
}
|
||||
```
|
@ -8,6 +8,7 @@
|
||||
basic
|
||||
vertical
|
||||
from-end
|
||||
grid-debug
|
||||
```
|
||||
|
||||
## Props
|
||||
|
@ -103,7 +103,7 @@ export default defineComponent({
|
||||
style={{
|
||||
display: inline ? 'inline-flex' : 'flex',
|
||||
flexDirection: vertical ? 'column' : 'row',
|
||||
flexWrap: !wrap ? 'nowrap' : 'wrap',
|
||||
flexWrap: !wrap || vertical ? 'nowrap' : 'wrap',
|
||||
justifyContent: 'flex-' + justify,
|
||||
marginTop: vertical ? '' : `-${semiVerticalMargin}`,
|
||||
marginBottom: vertical ? '' : `-${semiVerticalMargin}`,
|
||||
|
Loading…
Reference in New Issue
Block a user