index.vue 720 B

123456789101112131415161718192021222324252627282930
  1. <script lang="ts" setup>
  2. import { HOME_PAGE } from '@/utils'
  3. definePage({
  4. style: {
  5. // 'custom' 表示开启自定义导航栏,默认 'default'
  6. navigationStyle: 'custom',
  7. },
  8. })
  9. function goBack() {
  10. // 当pages.config.ts中配置了tabbar页面时,使用switchTab切换到首页
  11. // 否则使用navigateTo返回首页
  12. uni.switchTab({ url: HOME_PAGE })
  13. }
  14. </script>
  15. <template>
  16. <view class="h-screen flex flex-col items-center justify-center">
  17. <view> 404 </view>
  18. <view> 页面不存在 </view>
  19. <button class="mt-6 w-40 text-center" @click="goBack">
  20. 返回首页
  21. </button>
  22. </view>
  23. </template>
  24. <style lang="scss" scoped>
  25. //
  26. </style>