-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(grid-item): no resposive behavior, closes #1220
- Loading branch information
Showing
11 changed files
with
184 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Responsive Grid Item | ||
|
||
`n-grid-item`'s `span`, `offset` support responsive config. | ||
|
||
When `span` is 0, `n-grid-item` won't be displayed. | ||
|
||
```html | ||
<n-divider>Self Responsive</n-divider> | ||
<n-grid cols="4" item-responsive> | ||
<n-grid-item span="0 400:1 600:2 800:3"> | ||
<div class="light-green"> | ||
0 ~ 400px: hidden<br /> | ||
400 ~ 600px: span 1<br /> | ||
600 ~ 800px: span 2<br /> | ||
800px 以上: span 3 | ||
</div> | ||
</n-grid-item> | ||
<n-grid-item> | ||
<div class="green">2</div> | ||
</n-grid-item> | ||
</n-grid> | ||
<n-divider>Screen Responsive</n-divider> | ||
<n-grid cols="4" item-responsive responsive="screen"> | ||
<n-grid-item span="0 m:1 l:2"> | ||
<div class="light-green"> | ||
m-: hidden<br /> | ||
m ~ l: span 1<br /> | ||
l+: span 2 | ||
</div> | ||
</n-grid-item> | ||
<n-grid-item> | ||
<div class="green">2</div> | ||
</n-grid-item> | ||
</n-grid> | ||
``` | ||
|
||
```css | ||
.light-green { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 200px; | ||
background-color: rgba(0, 128, 0, 0.12); | ||
} | ||
.green { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 200px; | ||
background-color: rgba(0, 128, 0, 0.24); | ||
} | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 响应式栅格项 | ||
|
||
`n-grid-item` 的 `span` `offset` 支持响应式参数配置。需要在 `n-grid` 上设定 `item-responsive`。 | ||
|
||
当 `span` 为 0 的时候,`n-grid-item` 不会被显示。 | ||
|
||
```html | ||
<n-divider>Self 响应式</n-divider> | ||
<n-grid cols="4" item-responsive> | ||
<n-grid-item span="0 400:1 600:2 800:3"> | ||
<div class="light-green"> | ||
0~400px:不显示<br /> | ||
400~600px:占据空间 1<br /> | ||
600~800px:占据空间 2<br /> | ||
800px 以上:占据空间 3 | ||
</div> | ||
</n-grid-item> | ||
<n-grid-item> | ||
<div class="green">2</div> | ||
</n-grid-item> | ||
</n-grid> | ||
<n-divider>Screen 响应式</n-divider> | ||
<n-grid cols="4" item-responsive responsive="screen"> | ||
<n-grid-item span="0 m:1 l:2"> | ||
<div class="light-green"> | ||
m 以下:不显示<br /> | ||
m 到 l:占据空间 1<br /> | ||
l 以上:占据空间 2 | ||
</div> | ||
</n-grid-item> | ||
<n-grid-item> | ||
<div class="green">2</div> | ||
</n-grid-item> | ||
</n-grid> | ||
``` | ||
|
||
```css | ||
.light-green { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 200px; | ||
background-color: rgba(0, 128, 0, 0.12); | ||
} | ||
.green { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 200px; | ||
background-color: rgba(0, 128, 0, 0.24); | ||
} | ||
``` |
This file contains 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
This file contains 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