forked from hcfq/element
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Result: add result component (ElemeFE#21171)
- Loading branch information
1 parent
a1de1e3
commit 1de37b4
Showing
21 changed files
with
692 additions
and
11 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,76 @@ | ||
## Result | ||
|
||
Used to give feedback on the result of user's operation or access exception. | ||
|
||
### Basic usage | ||
|
||
:::demo | ||
|
||
```html | ||
<el-row> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="success" title="Success Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="warning" title="Warning Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="error" title="Error Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="info" title="Info Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
</el-row> | ||
``` | ||
|
||
::: | ||
|
||
### Customized content | ||
|
||
:::demo | ||
|
||
```html | ||
<el-result title="404" subTitle="Sorry, request error"> | ||
<template slot="icon"> | ||
<el-image src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"></el-image> | ||
</template> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
``` | ||
|
||
::: | ||
|
||
### Result Attributes | ||
|
||
| Attribute | Description | Type | Accepted Values | Default | | ||
|------------- |---------------- |---------------- |---------------------- |-------- | | ||
| title | title | string | — | — | | ||
| sub-title | sub title | string | — | — | | ||
| icon | icon type | string | success / warning / info / error | info | | ||
|
||
### Result Slots | ||
|
||
| Name | Description | | ||
|------|--------| | ||
| icon | custom icon | | ||
| title | custom title | | ||
| subTitle | custom sub title | | ||
| extra | custom extra area | |
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,76 @@ | ||
## Result | ||
|
||
Used to give feedback on the result of user's operation or access exception. | ||
|
||
### Basic usage | ||
|
||
:::demo | ||
|
||
```html | ||
<el-row> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="success" title="Success Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="warning" title="Warning Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="error" title="Error Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="info" title="Info Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
</el-row> | ||
``` | ||
|
||
::: | ||
|
||
### Customized content | ||
|
||
:::demo | ||
|
||
```html | ||
<el-result title="404" subTitle="Sorry, request error"> | ||
<template slot="icon"> | ||
<el-image src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"></el-image> | ||
</template> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
``` | ||
|
||
::: | ||
|
||
### Result Attributes | ||
|
||
| Attribute | Description | Type | Accepted Values | Default | | ||
|------------- |---------------- |---------------- |---------------------- |-------- | | ||
| title | title | string | — | — | | ||
| sub-title | sub title | string | — | — | | ||
| icon | icon type | string | success / warning / info / error | info | | ||
|
||
### Result Slots | ||
|
||
| Name | Description | | ||
|------|--------| | ||
| icon | custom icon | | ||
| title | custom title | | ||
| subTitle | custom sub title | | ||
| extra | custom extra area | |
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,76 @@ | ||
## Result | ||
|
||
Used to give feedback on the result of user's operation or access exception. | ||
|
||
### Basic usage | ||
|
||
:::demo | ||
|
||
```html | ||
<el-row> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="success" title="Success Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="warning" title="Warning Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="error" title="Error Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="info" title="Info Tip" subTitle="Please follow the instructions"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
</el-row> | ||
``` | ||
|
||
::: | ||
|
||
### Customized content | ||
|
||
:::demo | ||
|
||
```html | ||
<el-result title="404" subTitle="Sorry, request error"> | ||
<template slot="icon"> | ||
<el-image src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"></el-image> | ||
</template> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">Back</el-button> | ||
</template> | ||
</el-result> | ||
``` | ||
|
||
::: | ||
|
||
### Result Attributes | ||
|
||
| Attribute | Description | Type | Accepted Values | Default | | ||
|------------- |---------------- |---------------- |---------------------- |-------- | | ||
| title | title | string | — | — | | ||
| sub-title | sub title | string | — | — | | ||
| icon | icon type | string | success / warning / info / error | info | | ||
|
||
### Result Slots | ||
|
||
| Name | Description | | ||
|------|--------| | ||
| icon | custom icon | | ||
| title | custom title | | ||
| subTitle | custom sub title | | ||
| extra | custom extra area | |
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,76 @@ | ||
## Result 结果 | ||
|
||
用于对用户的操作结果或者异常状态做反馈。 | ||
|
||
### 基础用法 | ||
|
||
:::demo | ||
|
||
```html | ||
<el-row> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="success" title="成功提示" subTitle="请根据提示进行操作"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">返回</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="warning" title="警告提示" subTitle="请根据提示进行操作"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">返回</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="error" title="错误提示" subTitle="请根据提示进行操作"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">返回</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
<el-col :sm="12" :lg="6"> | ||
<el-result icon="info" title="信息提示" subTitle="请根据提示进行操作"> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">返回</el-button> | ||
</template> | ||
</el-result> | ||
</el-col> | ||
</el-row> | ||
``` | ||
|
||
::: | ||
|
||
### 自定义内容 | ||
|
||
:::demo | ||
|
||
```html | ||
<el-result title="404" subTitle="抱歉,请求错误"> | ||
<template slot="icon"> | ||
<el-image src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"></el-image> | ||
</template> | ||
<template slot="extra"> | ||
<el-button type="primary" size="medium">返回</el-button> | ||
</template> | ||
</el-result> | ||
``` | ||
|
||
::: | ||
|
||
### Result Attributes | ||
|
||
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ||
|------------- |---------------- |---------------- |---------------------- |-------- | | ||
| title | 标题 | string | — | — | | ||
| sub-title | 二级标题 | string | — | — | | ||
| icon | 图标类型 | string | success / warning / info / error | info | | ||
|
||
### Result Slots | ||
|
||
| Name | 说明 | | ||
|------|--------| | ||
| icon | 自定义图标 | | ||
| title | 自定义标题 | | ||
| subTitle | 自定义二级标题 | | ||
| extra | 自定义底部额外区域 | |
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,8 @@ | ||
import Result from './src/index.vue'; | ||
|
||
/* istanbul ignore next */ | ||
Result.install = function(Vue) { | ||
Vue.component(Result.name, Result); | ||
}; | ||
|
||
export default Result; |
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,13 @@ | ||
<template> | ||
<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.57818,15.42182 C32.0157534,14.8593933 31.1038797,14.8593933 30.541453,15.42182 L30.541453,15.42182 L24.0006789,21.9625941 L17.458547,15.42182 C16.8961203,14.8593933 15.9842466,14.8593933 15.42182,15.42182 C14.8593933,15.9842466 14.8593933,16.8961203 15.42182,17.458547 L15.42182,17.458547 L21.9639519,23.9993211 L15.42182,30.541453 C14.8593933,31.1038797 14.8593933,32.0157534 15.42182,32.57818 C15.9842466,33.1406067 16.8961203,33.1406067 17.458547,32.57818 L17.458547,32.57818 L24.0006789,26.0360481 L30.541453,32.57818 C31.1038797,33.1406067 32.0157534,33.1406067 32.57818,32.57818 C33.1406067,32.0157534 33.1406067,31.1038797 32.57818,30.541453 L32.57818,30.541453 L26.0374059,23.9993211 L32.57818,17.458547 C33.1406067,16.8961203 33.1406067,15.9842466 32.57818,15.42182 Z" | ||
/> | ||
</svg> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'IconError' | ||
}; | ||
</script> |
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,13 @@ | ||
<template> | ||
<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
d="M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M24,19 L21,19 C20.1715729,19 19.5,19.6715729 19.5,20.5 C19.5,21.3284271 20.1715729,22 21,22 L21,22 L22.5,22 L22.5,31 L21,31 C20.1715729,31 19.5,31.6715729 19.5,32.5 C19.5,33.3284271 20.1715729,34 21,34 L21,34 L27,34 C27.8284271,34 28.5,33.3284271 28.5,32.5 C28.5,31.6715729 27.8284271,31 27,31 L27,31 L25.5,31 L25.5,20.5 C25.5,19.6715729 24.8284271,19 24,19 L24,19 Z M24,13 C22.8954305,13 22,13.8954305 22,15 C22,16.1045695 22.8954305,17 24,17 C25.1045695,17 26,16.1045695 26,15 C26,13.8954305 25.1045695,13 24,13 Z" | ||
/> | ||
</svg> | ||
</template> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: 'IconInfo' | ||
}; | ||
</script> |
Oops, something went wrong.