更新 exception 组件
@ -1,6 +1,34 @@
|
|||||||
::: anchor
|
::: anchor
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
::: title 401
|
||||||
|
:::
|
||||||
|
|
||||||
|
::: demo 使用 `lay-exception` 标签, 创建一个异常页面
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<lay-exception status="401" title="401" describe="暂无相关权限">
|
||||||
|
<template #action>
|
||||||
|
<lay-button>刷新</lay-button>
|
||||||
|
<lay-button type="primary">返回</lay-button>
|
||||||
|
</template>
|
||||||
|
</lay-exception>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
::: title 403
|
::: title 403
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
85
src/component/exception/image/401.svg
Normal file
After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 195 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 195 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 209 KiB |
@ -4,11 +4,13 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
> div {
|
> div {
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
height: 200px;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
.error-401 {
|
||||||
|
background-image: url(./image/401.svg);
|
||||||
|
}
|
||||||
.error-403 {
|
.error-403 {
|
||||||
background-image: url(./image/403.svg);
|
background-image: url(./image/403.svg);
|
||||||
}
|
}
|
||||||
@ -21,16 +23,17 @@
|
|||||||
}
|
}
|
||||||
.layui-exception-details{
|
.layui-exception-details{
|
||||||
.layui-exception-details-content {
|
.layui-exception-details-content {
|
||||||
|
margin-left: 100px;
|
||||||
.layui-exception-details-title{
|
.layui-exception-details-title{
|
||||||
font-size: 68px;
|
font-size: 60px;
|
||||||
color: #434e59;
|
color: #434e59;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.layui-exception-details-describe{
|
.layui-exception-details-describe{
|
||||||
font-size: 20px;
|
font-size: 18px;
|
||||||
color: rgba(0, 0, 0, .45);
|
color: rgba(0, 0, 0, .45);
|
||||||
margin-bottom: 16px;
|
margin-bottom: 26px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { useSlots } from '@vue/runtime-core';
|
||||||
export default {
|
export default {
|
||||||
name: "LayException"
|
name: "LayException"
|
||||||
}
|
}
|
||||||
@ -8,22 +9,27 @@ import "./index.less";
|
|||||||
|
|
||||||
export interface LayDropdownProps {
|
export interface LayDropdownProps {
|
||||||
title?: string,
|
title?: string,
|
||||||
status?: '403' | '404' | '500',
|
status?: '401' | '403' | '404' | '500',
|
||||||
describe?: string
|
describe?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const slot = useSlots();
|
||||||
|
|
||||||
const props = withDefaults(defineProps<LayDropdownProps>(), {
|
const props = withDefaults(defineProps<LayDropdownProps>(), {
|
||||||
title: "Exception",
|
title: "Exception",
|
||||||
describe: "describe"
|
describe: "describe"
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="layui-exception">
|
<div class="layui-exception">
|
||||||
<div class="layui-exception-image">
|
<div class="layui-exception-image">
|
||||||
<div v-if="status=='403'" class="error-403" />
|
<slot name="image" v-if="slot.default"></slot>
|
||||||
<div v-if="status=='404'" class="error-404" />
|
<template v-else>
|
||||||
<div v-if="status=='500'" class="error-500" />
|
<div v-if="status=='401'" class="error-401" />
|
||||||
|
<div v-if="status=='403'" class="error-403" />
|
||||||
|
<div v-if="status=='404'" class="error-404" />
|
||||||
|
<div v-if="status=='500'" class="error-500" />
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-exception-details">
|
<div class="layui-exception-details">
|
||||||
<div class="layui-exception-details-content">
|
<div class="layui-exception-details-content">
|
||||||
|