mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
perf: 规范template模版中路由写法,不再使用$route和$router,此写法vue-tsc编译不通过
This commit is contained in:
@@ -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
|
||||
>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user