refactor: optimize the router system and implement unit tests for router (#495)

This commit is contained in:
Fine0830
2025-08-28 21:11:46 +08:00
committed by GitHub
parent f069c8a081
commit a7972af3b4
20 changed files with 2327 additions and 170 deletions

View File

@@ -14,13 +14,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { RouteRecordRaw } from "vue-router";
import type { AppRouteRecordRaw } from "@/types/router";
import { ROUTE_NAMES, ROUTE_PATHS } from "./constants";
import NotFound from "@/views/NotFound.vue";
export const routesNotFound: Array<RouteRecordRaw> = [
export const routesNotFound: AppRouteRecordRaw[] = [
{
path: "/:pathMatch(.*)*",
name: "NotFound",
path: ROUTE_PATHS.NOT_FOUND,
name: ROUTE_NAMES.NOT_FOUND,
component: NotFound,
meta: {
title: "Page Not Found",
notShow: true,
},
},
];