mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-06-14 21:05:08 +08:00
✨添加动态路由测试页
This commit is contained in:
parent
f7d960e8c3
commit
f2dd815dc1
@ -87,7 +87,9 @@
|
|||||||
watch: {
|
watch: {
|
||||||
$route: {
|
$route: {
|
||||||
handler({ fullPath }) {
|
handler({ fullPath }) {
|
||||||
|
//暂未研究清楚此处,待改进
|
||||||
if (fullPath === "/index") fullPath = "/";
|
if (fullPath === "/index") fullPath = "/";
|
||||||
|
if (fullPath === "/test/test") fullPath = "/test";
|
||||||
this.selectedKeys = [fullPath];
|
this.selectedKeys = [fullPath];
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
@ -43,6 +43,26 @@ export const asyncRoutes = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/test",
|
||||||
|
component: Layout,
|
||||||
|
redirect: "/test/test",
|
||||||
|
meta: {
|
||||||
|
title: "动态路由测试",
|
||||||
|
icon: "test-tube-line",
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "test",
|
||||||
|
name: "Test",
|
||||||
|
component: () => import("@/views/test"),
|
||||||
|
meta: {
|
||||||
|
title: "动态路由测试",
|
||||||
|
icon: "test-tube-line",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/error",
|
path: "/error",
|
||||||
name: "Error",
|
name: "Error",
|
||||||
|
11
src/views/test/index.vue
Normal file
11
src/views/test/index.vue
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<div class="test-container">
|
||||||
|
<a-alert message="动态路由测试"></a-alert>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "Test",
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
x
Reference in New Issue
Block a user