尝试解决一些ts的类型问题。
This commit is contained in:
@@ -78,14 +78,25 @@
|
||||
// @ts-expect-error 之后再补充类型文件
|
||||
import { hasOnlyChild } from "@/router/index.js";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
// import { useRoute, useRouter, type RouteRecordNormalized, type _RouteRecordBase } from "vue-router";
|
||||
import { computed } from "vue";
|
||||
|
||||
// declare interface SideBarRouteRecordNormalized extends RouteRecordNormalized
|
||||
// {
|
||||
// hidden?: boolean;
|
||||
// }
|
||||
|
||||
// declare interface SideBarRouteRecordSingleView extends _RouteRecordBase
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
export default {
|
||||
name: "LayoutAside",
|
||||
setup()
|
||||
{
|
||||
const router = useRouter();
|
||||
const routes = router.getRoutes();
|
||||
const routes = router.getRoutes();// as SideBarRouteRecordNormalized[];
|
||||
|
||||
const currentPath = computed(() =>
|
||||
{
|
||||
|
20
code/web/task_schedule/src/router/index.d.ts
vendored
Normal file
20
code/web/task_schedule/src/router/index.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-03-26 23:30:16
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /task_schedule/src/router/index.d.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
import { type RouteRecordNormalized, type RouteRecordRaw } from "vue-router";
|
||||
|
||||
export declare interface SideBarRouteRecordNormalized extends RouteRecordNormalized
|
||||
{
|
||||
hidden?: boolean;
|
||||
}
|
||||
|
||||
export declare let route: SideBarRouteRecordNormalized;
|
||||
|
||||
// export declare interface SideBarRouteRecordRaw extends RouteRecordRaw
|
||||
// {}
|
Reference in New Issue
Block a user