From 251d2411f235e23209d57173857e05b637729ce8 Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail.com> Date: 星期日, 02 四月 2023 01:01:56 +0800 Subject: [PATCH] refactor ts --- src/views/error/401.vue | 53 ++++++++++++++++++++++++----------------------------- 1 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/views/error/401.vue b/src/views/error/401.vue index 1ba3792..e163a31 100644 --- a/src/views/error/401.vue +++ b/src/views/error/401.vue @@ -1,42 +1,37 @@ <template> - <div class="errPage-container"> - <el-button icon="arrow-left" class="pan-back-btn" @click="back"> - 杩斿洖 - </el-button> - <el-row> - <el-col :span="12"> - <h1 class="text-jumbo text-ginormous"> - 401閿欒! - </h1> - <h2>鎮ㄦ病鏈夎闂潈闄愶紒</h2> - <h6>瀵逛笉璧凤紝鎮ㄦ病鏈夎闂潈闄愶紝璇蜂笉瑕佽繘琛岄潪娉曟搷浣滐紒鎮ㄥ彲浠ヨ繑鍥炰富椤甸潰</h6> - <ul class="list-unstyled"> - <li class="link-type"> - <router-link to="/"> - 鍥為椤� - </router-link> - </li> - </ul> - </el-col> - <el-col :span="12"> - <img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream."> - </el-col> - </el-row> - </div> + <div class="errPage-container"> + <el-button icon="arrow-left" class="pan-back-btn" @click="back"> 杩斿洖 </el-button> + <el-row> + <el-col :span="12"> + <h1 class="text-jumbo text-ginormous">401閿欒!</h1> + <h2>鎮ㄦ病鏈夎闂潈闄愶紒</h2> + <h6>瀵逛笉璧凤紝鎮ㄦ病鏈夎闂潈闄愶紝璇蜂笉瑕佽繘琛岄潪娉曟搷浣滐紒鎮ㄥ彲浠ヨ繑鍥炰富椤甸潰</h6> + <ul class="list-unstyled"> + <li class="link-type"> + <router-link to="/"> 鍥為椤� </router-link> + </li> + </ul> + </el-col> + <el-col :span="12"> + <img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream." /> + </el-col> + </el-row> + </div> </template> -<script setup> -import errImage from "@/assets/401_images/401.gif"; +<script setup lang="ts"> +import errImage from '@/assets/401_images/401.gif'; +import { ComponentInternalInstance } from "vue"; -let { proxy } = getCurrentInstance(); +let { proxy } = getCurrentInstance() as ComponentInternalInstance; const errGif = ref(errImage + "?" + +new Date()); function back() { - if (proxy.$route.query.noGoBack) { + if (proxy?.$route.query.noGoBack) { proxy.$router.push({ path: "/" }); } else { - proxy.$router.go(-1); + proxy?.$router.go(-1); } } </script> -- Gitblit v1.9.3