-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(empty): add empty component,and update styles. #298
- Loading branch information
Showing
7 changed files
with
228 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<template> | ||
<article> | ||
<h1> | ||
<code><veui-empty></code> | ||
</h1> | ||
<h2>尺寸</h2> | ||
<div class="options-desc">可选的尺寸 <span class="bg-gray-show">ui</span> 属性值: <span class="bg-gray-show">s(默认) / m</span></div> | ||
<section> | ||
<veui-form> | ||
<veui-field label="小号[ui=s]" ui="multi" class="tow-line-field"> | ||
<veui-empty> | ||
<template #default> | ||
<veui-icon name="data-file-box-lg"/> | ||
</template> | ||
</veui-empty> | ||
</veui-field> | ||
<veui-field label="中号[ui=m]" ui="multi" class="tow-line-field"> | ||
<veui-empty ui="m"> | ||
<template #default> | ||
<veui-icon name="data-file-box-lg"/> | ||
</template> | ||
</veui-empty> | ||
</veui-field> | ||
</veui-form> | ||
</section> | ||
<h2 style="margin-top: 50px;">更多功能demo示例(UI不需还原)</h2> | ||
<section> | ||
<veui-check-button-group v-model="partValue" :items="parts"/> | ||
<veui-radio-button-group v-model="ui" :items="uis" class="ml-4"/> | ||
<veui-empty class="mt-4" :ui="ui" :desc="false" :image="false"> | ||
<template | ||
v-if="partValue.includes('title')" | ||
#title | ||
>找不到该页面</template> | ||
<template | ||
v-if="partValue.includes('desc')" | ||
#desc | ||
>当前页面无法访问,请检查地址栏中的网址,确保您访问的是正确的网址。</template> | ||
<template v-if="partValue.includes('image')" #default> | ||
<veui-icon name="data-folder-search-lg"></veui-icon> | ||
</template> | ||
<template v-if="partValue.includes('actions')" #actions> | ||
<veui-button ui="primary">确定</veui-button> | ||
<veui-button>取消</veui-button> | ||
</template> | ||
</veui-empty> | ||
</section> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import {Button, Empty, CheckButtonGroup, RadioButtonGroup, Icon, Form, Field} from 'veui'; | ||
import 'veui-theme-blue-icons/data-file-box-lg'; | ||
import 'veui-theme-blue-icons/data-folder-search-lg'; | ||
function genLabel(value) { | ||
return {label: value, value}; | ||
} | ||
export default { | ||
name: 'empty-demo', | ||
components: { | ||
'veui-button': Button, | ||
'veui-empty': Empty, | ||
'veui-check-button-group': CheckButtonGroup, | ||
'veui-radio-button-group': RadioButtonGroup, | ||
'veui-icon': Icon, | ||
'veui-form': Form, | ||
'veui-field': Field | ||
}, | ||
data() { | ||
return { | ||
parts: ['image', 'title', 'desc', 'actions'].map(genLabel), | ||
uis: ['s', 'm'].map(genLabel), | ||
ui: 'm', | ||
partValue: ['image', 'title', 'desc', 'actions'] | ||
}; | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
section { | ||
margin-bottom: 40px; | ||
} | ||
.ml-4 { | ||
margin-left: 16px; | ||
} | ||
.mt-4 { | ||
margin-top: 16px; | ||
} | ||
</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
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,14 @@ | ||
import ui from 'veui/managers/ui'; | ||
|
||
ui.defaults( | ||
{ | ||
ui: { | ||
size: { | ||
values: ['s', 'm'], | ||
inherit: true, | ||
default: 's' | ||
} | ||
} | ||
}, | ||
'empty' | ||
); |
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,79 @@ | ||
@import "../lib.less"; | ||
@import "../variables/components/empty.less"; | ||
|
||
.@{veui-prefix}-empty { | ||
text-align: center; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
|
||
&-title { | ||
line-height: @veui-empty-title-line-height; | ||
color: @veui-empty-title-font-color; | ||
font-weight: @veui-empty-title-font-weight; | ||
} | ||
|
||
&-image, | ||
&-title, | ||
&-desc { | ||
&:not(:first-child) { | ||
margin-top: @veui-empty-content-spacing; | ||
} | ||
} | ||
|
||
&-desc { | ||
line-height: @veui-empty-desc-line-height; | ||
color: @veui-empty-desc-font-color; | ||
font-weight: @veui-empty-desc-font-weight; | ||
} | ||
|
||
&-actions:not(:first-child) { | ||
margin-top: @veui-empty-actions-spacing-before; | ||
} | ||
|
||
&-actions { | ||
.@{veui-prefix}-button + .@{veui-prefix}-button { | ||
margin-left: @veui-empty-actions-content-spacing; | ||
} | ||
} | ||
|
||
&[ui~="m"] { | ||
max-width: @veui-empty-max-width-m; | ||
|
||
.@{veui-prefix}-empty { | ||
&-image, | ||
&-image > * { | ||
width: @veui-empty-image-width-m; | ||
height: @veui-empty-image-height-m; | ||
} | ||
|
||
&-title { | ||
font-size: @veui-empty-title-font-size-m; | ||
} | ||
|
||
&-desc { | ||
font-size: @veui-empty-desc-font-size-m; | ||
} | ||
} | ||
} | ||
|
||
&[ui~="s"] { | ||
max-width: @veui-empty-max-width-s; | ||
|
||
.@{veui-prefix}-empty { | ||
&-image, | ||
&-image > * { | ||
width: @veui-empty-image-width-s; | ||
height: @veui-empty-image-height-s; | ||
} | ||
|
||
&-title { | ||
font-size: @veui-empty-title-font-size-s; | ||
} | ||
|
||
&-desc { | ||
font-size: @veui-empty-desc-font-size-s; | ||
} | ||
} | ||
} | ||
} |
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,29 @@ | ||
@import "../global.less"; | ||
|
||
/* Sizes */ | ||
@veui-empty-max-width-s: @veui-padding-unit * 60; | ||
@veui-empty-max-width-m: @veui-padding-unit * 80; | ||
@veui-empty-image-width-s: @veui-padding-unit * 19; | ||
@veui-empty-image-height-s: @veui-padding-unit * 18 - 2; | ||
@veui-empty-image-width-m: @veui-padding-unit * 23; | ||
@veui-empty-image-height-m: @veui-padding-unit * 22 - 2; | ||
|
||
|
||
/* Title */ | ||
@veui-empty-title-font-size-s: @veui-font-size-s; | ||
@veui-empty-title-font-size-m: @veui-font-size-m; | ||
@veui-empty-title-line-height: @veui-line-height-m; | ||
@veui-empty-title-font-color: @veui-font-color-normal; | ||
@veui-empty-title-font-weight: @veui-font-weight-2; | ||
|
||
/* Desc */ | ||
@veui-empty-desc-font-size-s: @veui-font-size-s; | ||
@veui-empty-desc-font-size-m: @veui-font-size-m; | ||
@veui-empty-desc-line-height: @veui-line-height-m; | ||
@veui-empty-desc-font-color: @veui-font-color-weak; | ||
@veui-empty-desc-font-weight: @veui-font-weight-1; | ||
|
||
/* Spacing */ | ||
@veui-empty-content-spacing: @veui-padding-unit * 2 - 2; | ||
@veui-empty-actions-spacing-before: @veui-padding-unit * 4; | ||
@veui-empty-actions-content-spacing: @veui-padding-unit * 2; |