|
|
@@ -6,7 +6,7 @@
|
|
|
|
|
|
### 安装
|
|
|
|
|
|
-``` javascript
|
|
|
+```javascript
|
|
|
import { createApp } from 'vue';
|
|
|
// vue
|
|
|
import { Layout,Row,Col } from '@nutui/nutui';
|
|
|
@@ -22,123 +22,196 @@ app.use(Col);
|
|
|
## 代码演示
|
|
|
|
|
|
### 基础用法
|
|
|
-
|
|
|
+:::demo
|
|
|
```html
|
|
|
-<nut-row>
|
|
|
- <nut-col :span="24">
|
|
|
- <div class="flex-content">span:24</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-<nut-row>
|
|
|
- <nut-col :span="12">
|
|
|
- <div class="flex-content">span:12</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="12">
|
|
|
- <div class="flex-content flex-content-light">span:12</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-<nut-row>
|
|
|
- <nut-col :span="8">
|
|
|
- <div class="flex-content">span:8</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="8">
|
|
|
- <div class="flex-content flex-content-light">span:8</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="8">
|
|
|
- <div class="flex-content">span:8</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-<nut-row>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content flex-content-light">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-```
|
|
|
-
|
|
|
-### 设置元素间距
|
|
|
-
|
|
|
-```html
|
|
|
-<nut-row :gutter="10">
|
|
|
+<template>
|
|
|
+ <nut-row>
|
|
|
+ <nut-col :span="24">
|
|
|
+ <div class="flex-content">span:24</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+ <nut-row>
|
|
|
+ <nut-col :span="12">
|
|
|
+ <div class="flex-content">span:12</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="12">
|
|
|
+ <div class="flex-content flex-content-light">span:12</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+ <nut-row>
|
|
|
<nut-col :span="8">
|
|
|
- <div class="flex-content">span:8</div>
|
|
|
+ <div class="flex-content">span:8</div>
|
|
|
</nut-col>
|
|
|
<nut-col :span="8">
|
|
|
- <div class="flex-content flex-content-light">span:8</div>
|
|
|
+ <div class="flex-content flex-content-light">span:8</div>
|
|
|
</nut-col>
|
|
|
<nut-col :span="8">
|
|
|
- <div class="flex-content">span:8</div>
|
|
|
+ <div class="flex-content">span:8</div>
|
|
|
</nut-col>
|
|
|
-</nut-row>
|
|
|
+ </nut-row>
|
|
|
+ <nut-row>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content flex-content-light">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+</template>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.nut-row {
|
|
|
+ overflow: hidden;
|
|
|
+ &:not(:last-child) .nut-col {
|
|
|
+ margin-bottom: 15px;
|
|
|
+ }
|
|
|
+ margin-bottom: 15px;
|
|
|
+}
|
|
|
+.flex-content {
|
|
|
+ line-height: 40px;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #ff8881;
|
|
|
+ &.flex-content-light {
|
|
|
+ background: #ffc7c4;
|
|
|
+ }
|
|
|
+ &.flex-content-height {
|
|
|
+ height: 50px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
```
|
|
|
+:::
|
|
|
+### 设置元素间距
|
|
|
+:::demo
|
|
|
+```html
|
|
|
+<template>
|
|
|
+ <nut-row :gutter="10">
|
|
|
+ <nut-col :span="8">
|
|
|
+ <div class="flex-content">span:8</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="8">
|
|
|
+ <div class="flex-content flex-content-light">span:8</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="8">
|
|
|
+ <div class="flex-content">span:8</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+</template>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.nut-row {
|
|
|
+ overflow: hidden;
|
|
|
+ &:not(:last-child) .nut-col {
|
|
|
+ margin-bottom: 15px;
|
|
|
+ }
|
|
|
+ margin-bottom: 15px;
|
|
|
+}
|
|
|
+.flex-content {
|
|
|
+ line-height: 40px;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #ff8881;
|
|
|
+ &.flex-content-light {
|
|
|
+ background: #ffc7c4;
|
|
|
+ }
|
|
|
+ &.flex-content-height {
|
|
|
+ height: 50px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+```
|
|
|
+:::
|
|
|
### Flex布局
|
|
|
-
|
|
|
+:::demo
|
|
|
```html
|
|
|
-<nut-row type="flex" wrap="nowrap">
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content flex-content-light">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-<nut-row type="flex" justify="center">
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content flex-content-light">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-<nut-row type="flex" justify="end">
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content flex-content-light">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-<nut-row type="flex" justify="space-between">
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content flex-content-light">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
-<nut-row type="flex" justify="space-around">
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content flex-content-light">span:6</div>
|
|
|
- </nut-col>
|
|
|
- <nut-col :span="6">
|
|
|
- <div class="flex-content">span:6</div>
|
|
|
- </nut-col>
|
|
|
-</nut-row>
|
|
|
+<template>
|
|
|
+ <nut-row type="flex" wrap="nowrap">
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content flex-content-light">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+ <nut-row type="flex" justify="center">
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content flex-content-light">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+ <nut-row type="flex" justify="end">
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content flex-content-light">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+ <nut-row type="flex" justify="space-between">
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content flex-content-light">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+ <nut-row type="flex" justify="space-around">
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content flex-content-light">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ <nut-col :span="6">
|
|
|
+ <div class="flex-content">span:6</div>
|
|
|
+ </nut-col>
|
|
|
+ </nut-row>
|
|
|
+</template>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.nut-row {
|
|
|
+ overflow: hidden;
|
|
|
+ &:not(:last-child) .nut-col {
|
|
|
+ margin-bottom: 15px;
|
|
|
+ }
|
|
|
+ margin-bottom: 15px;
|
|
|
+}
|
|
|
+.flex-content {
|
|
|
+ line-height: 40px;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #ff8881;
|
|
|
+ &.flex-content-light {
|
|
|
+ background: #ffc7c4;
|
|
|
+ }
|
|
|
+ &.flex-content-height {
|
|
|
+ height: 50px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
```
|
|
|
-
|
|
|
+:::
|
|
|
## Prop
|
|
|
|
|
|
### row
|