-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add empty, update veui, update Iframe component
- Loading branch information
Showing
15 changed files
with
494 additions
and
115 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,50 @@ | ||
# Empty <small>空状态</small> | ||
|
||
## 示例 | ||
|
||
### 默认 | ||
|
||
[[ demo src="/demo/empty/default.vue" ]] | ||
|
||
### 页面级 | ||
|
||
[[ demo src="/demo/empty/hero.vue" ]] | ||
|
||
### 局部状态 | ||
|
||
[[ demo src="/demo/empty/spot.vue" ]] | ||
|
||
### 自定义 | ||
|
||
[[ demo src="/demo/empty/custom.vue" ]] | ||
|
||
## API | ||
|
||
### 属性 | ||
|
||
| 名称 | 类型 | 默认值 | 描述 | | ||
| -- | -- | -- | -- | | ||
| ``ui`` | `string=` | - | [^ui] | | ||
| ``image`` | `Object | false=` | - | 插图内容配置。不传时将输出默认插图;传入 `Object` 时,字段将作为 `<img>` 元素的属性输出;传入 `false` 时将隐藏插图。如果为默认插槽传入了内容,此属性会被忽略。 | | ||
| ``title`` | `string=` | - | 空状态标题。 | | ||
| ``desc`` | `string | false=` | - | 空状态描述。传入 `false` 时将隐藏描述。 | | ||
|
||
^^^ui | ||
预设样式。 | ||
|
||
+++枚举值 | ||
| 值 | 描述 | | ||
| -- | -- | | ||
| `s` | 小尺寸空状态。全局插图不适合小尺寸样式。 | | ||
| `m` | 中尺寸空状态。 | | ||
+++ | ||
^^^ | ||
|
||
### 插槽 | ||
|
||
| 名称 | 描述 | | ||
| -- | -- | | ||
| ``default`` | 插图内容。默认情况下会展示“没有数据”对应的插图。 | | ||
| ``title`` | 标题区。 | | ||
| ``desc`` | 描述区。 | | ||
| ``actions`` | 操作区。 | |
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,63 @@ | ||
<template> | ||
<article> | ||
<section> | ||
<h4>内置 <code><img></code> 标签</h4> | ||
<veui-empty | ||
:image="image" | ||
title="找不到对应的内容" | ||
desc="请检查输入的网址是否正确" | ||
/> | ||
</section> | ||
<section> | ||
<h4>任意内容</h4> | ||
<veui-empty | ||
ui="s" | ||
title="未知错误" | ||
:desc="false" | ||
> | ||
<veui-icon | ||
name="exclamation-circle-solid" | ||
style="height: 96px; color: rebeccapurple;" | ||
/> | ||
</veui-empty> | ||
</section> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import { Empty, Icon } from 'veui' | ||
import 'veui-theme-dls-icons/exclamation-circle-solid' | ||
export default { | ||
components: { | ||
'veui-empty': Empty, | ||
'veui-icon': Icon | ||
}, | ||
data () { | ||
return { | ||
image: { | ||
src: 'http://ecma.bdimg.com/public01/one-design/597ed72aff7a9fbacf23ba79b43aa61d.png', | ||
width: 296, | ||
height: 197, | ||
alt: '404 illustration provided by unDraw' | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
section { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
& + & { | ||
margin-top: 20px; | ||
} | ||
} | ||
h4 { | ||
align-self: flex-start; | ||
} | ||
</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,23 @@ | ||
<template> | ||
<article> | ||
<veui-empty/> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import { Empty } from 'veui' | ||
export default { | ||
components: { | ||
'veui-empty': Empty | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
article { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
</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,85 @@ | ||
<template> | ||
<article> | ||
<section> | ||
<veui-select | ||
v-model="current" | ||
class="picker" | ||
ui="s" | ||
:options="options" | ||
overlay-style="--dls-dropdown-max-display-items: 4;" | ||
/> | ||
</section> | ||
<veui-empty | ||
title="没有权限" | ||
> | ||
<component :is="illustrations[current]"/> | ||
<template #desc> | ||
请联系管理员为你添加权限 | ||
<veui-button ui="strong text"> | ||
发送邮件 | ||
</veui-button> | ||
</template> | ||
<template #actions> | ||
<veui-button ui="primary"> | ||
回到首页 | ||
</veui-button> | ||
</template> | ||
</veui-empty> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import { Empty, Button, Select } from 'veui' | ||
import * as illustrations from 'dls-illustrations-vue' | ||
const illustrationNames = [ | ||
'IllustrationBlank', | ||
'IllustrationClientError', | ||
'IllustrationForbidden', | ||
'IllustrationNoResults', | ||
'IllustrationNotFound', | ||
'IllustrationReviewError', | ||
'IllustrationReviewPending', | ||
'IllustrationReviewSuccess', | ||
'IllustrationServerError' | ||
] | ||
export default { | ||
components: { | ||
'veui-empty': Empty, | ||
'veui-button': Button, | ||
'veui-select': Select | ||
}, | ||
data () { | ||
return { | ||
illustrations, | ||
current: 'IllustrationForbidden' | ||
} | ||
}, | ||
computed: { | ||
options () { | ||
return illustrationNames.map(name => ({ | ||
label: name, | ||
value: name | ||
})) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
article { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 30px; | ||
} | ||
section { | ||
align-self: flex-start; | ||
} | ||
.picker { | ||
width: 240px; | ||
} | ||
</style> |
Oops, something went wrong.
a98c5d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
veui-docs – ./
veui.vercel.app
veui-docs-ecomfe.vercel.app
veui.dev
veui-docs-git-master-ecomfe.vercel.app