zhangxiao
2024-08-26 57b66478e7e335379435b31c20da4619bd1411f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
    <div class="empty">
        <img :src="emptyImage" />
        <a-space>
            <!-- <a-button type="primary" @click="handleBack">返回上一页</a-button> -->
            <a-button @click="handleRetry">返回首页</a-button>
        </a-space>
    </div>
</template>
 
<script setup lang="ts">
import emptyImage from "@/assets/images/common/404.png";
import { getDefaultRoute } from "@/packages/vue-router";
const router = useRouter();
 
function handleRetry() {
    const defaultPage = getDefaultRoute();
    if (!defaultPage) {
        return;
    }
    router.replace(defaultPage);
}
 
// function handleBack() {
//     router.back();
// }
</script>
<style lang="scss" scoped>
.empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    img {
        width: 400px;
    }
}
</style>