vp-not-found.vue 679 B

123456789101112131415161718192021222324252627282930
  1. <script setup lang="ts">
  2. import { computed } from 'vue'
  3. import { isClient } from '@vueuse/core'
  4. import { useLang } from '../composables/lang'
  5. import localeData from '../../i18n/pages/not-found.json'
  6. const lang = useLang()
  7. const locale = computed(() => localeData[lang.value])
  8. const goHome = () => {
  9. if (!isClient) return
  10. window.location.href = `/${lang.value}/`
  11. }
  12. </script>
  13. <template>
  14. <el-result icon="error" :title="locale.title" :sub-title="locale.desc">
  15. <template #extra>
  16. <el-button @click="goHome">{{ locale['button-title'] }}</el-button>
  17. </template>
  18. </el-result>
  19. </template>
  20. <style scoped>
  21. .el-result {
  22. height: 100vh;
  23. width: 100vw;
  24. }
  25. </style>