-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
435 additions
and
979 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
packages/nutui-taro-demo/src/layout/pages/layout/basic.vue
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,53 @@ | ||
<template> | ||
<nut-row> | ||
<nut-col :span="24"> | ||
<div class="content">span:24</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row> | ||
<nut-col :span="12"> | ||
<div class="content">span:12</div> | ||
</nut-col> | ||
<nut-col :span="12"> | ||
<div class="content light">span:12</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row> | ||
<nut-col :span="8"> | ||
<div class="content">span:8</div> | ||
</nut-col> | ||
<nut-col :span="8"> | ||
<div class="content light">span:8</div> | ||
</nut-col> | ||
<nut-col :span="8"> | ||
<div class="content">span:8</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content light">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
</nut-row> | ||
</template> | ||
<style> | ||
.content { | ||
line-height: 40px; | ||
color: #fff; | ||
text-align: center; | ||
border-radius: 6px; | ||
background: #ff8881; | ||
margin-bottom: 10px; | ||
} | ||
.light { | ||
background: #ffc7c4; | ||
} | ||
</style> |
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,81 @@ | ||
<template> | ||
<nut-row type="flex" wrap="nowrap"> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content light">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row type="flex" justify="center"> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content light">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row type="flex" justify="end"> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content light">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row type="flex" justify="space-between"> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content light">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row type="flex" justify="space-around"> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content light">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
</nut-row> | ||
<nut-row type="flex" justify="space-evenly"> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content light">span:6</div> | ||
</nut-col> | ||
<nut-col :span="6"> | ||
<div class="content">span:6</div> | ||
</nut-col> | ||
</nut-row> | ||
</template> | ||
<style> | ||
.content { | ||
line-height: 40px; | ||
color: #fff; | ||
text-align: center; | ||
border-radius: 6px; | ||
background: #ff8881; | ||
margin-bottom: 10px; | ||
} | ||
.light { | ||
background: #ffc7c4; | ||
} | ||
</style> |
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,26 @@ | ||
<template> | ||
<nut-row :gutter="10"> | ||
<nut-col :span="8"> | ||
<div class="content">span:8</div> | ||
</nut-col> | ||
<nut-col :span="8"> | ||
<div class="content light">span:8</div> | ||
</nut-col> | ||
<nut-col :span="8"> | ||
<div class="content">span:8</div> | ||
</nut-col> | ||
</nut-row> | ||
</template> | ||
<style> | ||
.content { | ||
line-height: 40px; | ||
color: #fff; | ||
text-align: center; | ||
border-radius: 6px; | ||
background: #ff8881; | ||
margin-bottom: 10px; | ||
} | ||
.light { | ||
background: #ffc7c4; | ||
} | ||
</style> |
165 changes: 26 additions & 139 deletions
165
packages/nutui-taro-demo/src/layout/pages/layout/index.vue
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 |
---|---|---|
@@ -1,144 +1,31 @@ | ||
<template> | ||
<Demo class="full layout-demo"> | ||
<h2>基础布局</h2> | ||
<div class="box-item"> | ||
<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> | ||
</div> | ||
<h2>分栏间隔</h2> | ||
<div class="box-item"> | ||
<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> | ||
</div> | ||
<h2>Flex布局</h2> | ||
<div class="box-item"> | ||
<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> | ||
</div> | ||
<Demo class="demo full"> | ||
<h2>{{ t('basic') }}</h2> | ||
<Basic /> | ||
|
||
<h2>{{ t('gap') }}</h2> | ||
<Gap /> | ||
|
||
<h2>{{ t('flex') }}</h2> | ||
<Flex /> | ||
</Demo> | ||
</template> | ||
|
||
<style lang="scss"> | ||
.box-item { | ||
background: #fff; | ||
margin-bottom: 20px; | ||
padding: 20px 0; | ||
} | ||
.layout-demo .nut-row { | ||
overflow: hidden; | ||
&:not(:last-child) .nut-col { | ||
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; | ||
<script setup lang="ts"> | ||
import { useTranslate } from '../../../utils'; | ||
import Basic from './basic.vue'; | ||
import Gap from './gap.vue'; | ||
import Flex from './flex.vue'; | ||
const t = useTranslate({ | ||
'zh-CN': { | ||
basic: '基础用法', | ||
gap: '分栏间隔', | ||
flex: 'Flex 布局' | ||
}, | ||
'en-US': { | ||
basic: 'Basic Usage', | ||
gap: 'Column spacing', | ||
flex: 'Flex layout' | ||
} | ||
} | ||
</style> | ||
}); | ||
</script> |
Oops, something went wrong.