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,4 +1,5 @@
<script setup lang="tsx">
import { useRouter } from "vue-router";
import { h, createVNode, ref } from "vue";
import { message } from "@/utils/message";
import { cloneDeep } from "@pureadmin/utils";
@@ -9,6 +10,8 @@ defineOptions({
name: "Dialog"
});
const router = useRouter();
function onBaseClick() {
addDialog({
title: "基本使用",
@@ -380,7 +383,7 @@ function onBeforeSureClick() {
采用函数式调用弹框组件更多操作实例请参考
<span
class="cursor-pointer text-primary"
@click="$router.push({ name: 'Dept' })"
@click="router.push({ name: 'Dept' })"
>系统管理页面</span
>