修改路由
This commit is contained in:
parent
011fa5337c
commit
10a0917cdc
@ -128,6 +128,7 @@ export default defineComponent({
|
|||||||
name: string;
|
name: string;
|
||||||
route: string;
|
route: string;
|
||||||
}
|
}
|
||||||
|
// 左侧的列表数组
|
||||||
const list: Array<MenuItem> = [
|
const list: Array<MenuItem> = [
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
@ -160,8 +161,13 @@ export default defineComponent({
|
|||||||
route: ""
|
route: ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
// 当前选中的index
|
||||||
const selnum = ref(0);
|
const selnum = ref(0);
|
||||||
const routeto = (index: number) => {
|
/**
|
||||||
|
* 跳转路由与赋值对应的下标
|
||||||
|
* @param index 选中的下标 方便赋值与跳转
|
||||||
|
*/
|
||||||
|
function routeto(index: number): void {
|
||||||
console.log(index)
|
console.log(index)
|
||||||
selnum.value = index;
|
selnum.value = index;
|
||||||
|
|
||||||
|
40
src/layout/mine.vue
Normal file
40
src/layout/mine.vue
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mine">
|
||||||
|
<NavTop style="flex-shrink:0"></NavTop>
|
||||||
|
<div class="body">
|
||||||
|
<Menu style="flex-shrink:0"></Menu>
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mine{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.body{
|
||||||
|
display: flex;
|
||||||
|
.container{
|
||||||
|
width: 100%;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
padding: 23rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import Menu from "@/components/Menu.vue";
|
||||||
|
import NavTop from "@/components/NavTop.vue"
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components:{
|
||||||
|
Menu,
|
||||||
|
NavTop
|
||||||
|
},
|
||||||
|
setup(){
|
||||||
|
console.log(1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
@ -1,10 +1,21 @@
|
|||||||
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
|
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
|
||||||
|
|
||||||
const routes: Array<RouteRecordRaw> = [
|
const routes: Array<RouteRecordRaw> = [
|
||||||
|
{
|
||||||
|
path:"/mine",
|
||||||
|
name:"Mine",
|
||||||
|
component: () => import("../layout/mine.vue"),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path:"Archives",
|
||||||
|
component: () => import("../views/mine/Archives.vue")
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
component: () => import(/* webpackChunkName: "about" */ '../components/Nav.vue')
|
component: () => import(/* webpackChunkName: "about" */ '../components/NavTop.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/about',
|
path: '/about',
|
||||||
|
Loading…
Reference in New Issue
Block a user