perf: 规范template模版中路由写法,不再使用$route$router,此写法vue-tsc编译不通过

This commit is contained in:
xiaoxian521
2023-05-12 13:01:59 +08:00
parent a1b8b27a1c
commit 1aba27590f
7 changed files with 27 additions and 12 deletions

View File

@@ -1,9 +1,12 @@
<script setup lang="ts">
import { useRouter } from "vue-router";
import noAccess from "@/assets/status/403.svg?component";
defineOptions({
name: "403"
});
const router = useRouter();
</script>
<template>
@@ -46,7 +49,7 @@ defineOptions({
</p>
<el-button
type="primary"
@click="$router.push('/')"
@click="router.push('/')"
v-motion
:initial="{
opacity: 0,