hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
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
41
42
43
44
45
<template>
  <div class="e404">
    <h6 class="fix">GET 404!</h6>
    <br>
    <el-button
      v-for="(i,j) in nav"
      :key="j+'-nav-404'"
      @click.stop="gos(i.path)"
    >{{i.title}}</el-button>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      src: "",
      nav: [],
    };
  },
  methods: {
    gos(v) {
      this.$router.push(v);
    },
  },
  mounted() {
    let x = this.$router.options.routes;
    x = x
      .filter((k) => {
        return k.path !== "/" && k.path !== "/*";
      })
      .map((k) => {
        return { path: k.path, title: k.meta.title };
      });
    this.nav = x;
  },
};
</script>
<style lang='less' scoped>
.e404 {
  button {
    margin-bottom: 10px;
  }
}
</style>