refactor(projects): 添加exportDefaults替换defineProps

This commit is contained in:
Soybean
2021-11-07 01:23:01 +08:00
committed by Soybean
parent 43b832bee0
commit e61ee32a88
42 changed files with 886 additions and 970 deletions

View File

@ -1,24 +1,24 @@
<template>
<div class="w-400px h-400px">
<svg-no-permission v-if="type === '403'" :color="color" />
<svg-not-found v-if="type === '404'" :color="color" />
<svg-service-error v-if="type === '500'" :color="color" />
<div class="w-400px h-400px" :style="{ color }">
<svg-no-permission v-if="type === '403'" />
<svg-not-found v-if="type === '404'" />
<svg-service-error v-if="type === '500'" />
</div>
</template>
<script lang="ts" setup>
import type { PropType } from 'vue';
import { SvgNoPermission, SvgNotFound, SvgServiceError } from './components';
defineProps({
type: {
type: String as PropType<'403' | '404' | '500'>,
default: '404'
},
color: {
type: String,
required: true
}
interface Props {
/** 异常类型 */
type?: '403' | '404' | '500';
/** 主题颜色 */
color?: string;
}
withDefaults(defineProps<Props>(), {
type: '404',
color: '#409eff'
});
</script>
<style scoped></style>