提交 8ffac32b 编写于 作者: T tinyu

Thu Mar 28 09:56:00 CST 2024 inscode

上级 c7e4d4de
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</template> </template>
<script> <script>
import Layout from '@/components/layout.vue' import Layout from '@/components/layout/index.vue'
export default { export default {
name: 'App', name: 'App',
components: { components: {
......
<template>
<div>
<router-view></router-view>
</div>
</template>
<script>
export default{
name:'DynamicRoute',
data(){
return {
}
},
mounted(){
},
methods:{
},
}
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -3,37 +3,39 @@ ...@@ -3,37 +3,39 @@
<el-header> <el-header>
<el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect" <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect"
background-color="#545c64" text-color="#fff" active-text-color="#ffd04b"> background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
<el-menu-item index="1"><i class="el-icon-s-home"></i>主页</el-menu-item> <template>
<el-menu-item index="1"><i class="el-icon-s-pie"></i>主页</el-menu-item>
</template>
<el-submenu index="2"> <el-submenu index="2">
<template slot="title">我的工作台</template> <template slot="title">我的工作台</template>
<el-menu-item index="2-1">选项1</el-menu-item> <el-menu-item index="2-1">选项1</el-menu-item>
<el-menu-item index="2-2">选项2</el-menu-item> <el-menu-item index="2-2">选项2</el-menu-item>
<el-menu-item index="2-3">选项3</el-menu-item> <el-menu-item index="2-3">选项3</el-menu-item>
<el-submenu index="2-4">
<template slot="title">选项4</template>
<el-menu-item index="2-4-1">选项1</el-menu-item>
<el-menu-item index="2-4-2">选项2</el-menu-item>
<el-menu-item index="2-4-3">选项3</el-menu-item>
</el-submenu>
</el-submenu> </el-submenu>
<el-menu-item index="3" disabled>消息中心</el-menu-item> <el-menu-item index="3" disabled>消息中心</el-menu-item>
<el-menu-item index="4"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item> <el-menu-item index="4"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item>
</el-menu> </el-menu>
</el-header> </el-header>
<el-main> <el-main>
<router-view></router-view> <DynamicRoute/>
</el-main> </el-main>
</el-container> </el-container>
</template> </template>
<script> <script>
import DynamicRoute from './dynamicRoute.vue';
import routes from '@/router/routes'
function converRouteData(arr){
};
export default { export default {
name: 'layout', name: 'layout',
components:{DynamicRoute},
data() { data() {
return { return {
activeIndex: '1', menuList:[]
activeIndex2: '1'
} }
}, },
methods: { methods: {
handleSelect(key, keyPath) { handleSelect(key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath);
......
import Home from '@/views/Home/index.vue' import Home from '@/views/Home/index.vue'
import DynamicRoute from '@/components/layout/dynamicRoute.vue'
export default [ export default [
{ {
path:'/', path:'/',
meta:{title:'主页',icon:'el-icon-s-home'},
name:'home', name:'home',
meta:{},
component:Home component:Home
}, },
{ {
path:'echarts', path:'/element-ui',
redirect:'gantt', meta:{title:'Element-Ui',icon:''},
component:DynamicRoute,
},
{
path:'/antdv',
meta:{title:'Ant-Design-Vue',icon:''},
component:DynamicRoute,
},
{
path:'/echarts',
meta:{title:'Echarts',icon:''},
component:DynamicRoute,
redirect:'/echarts/gantt',
children:[ children:[
{ {
path:'/echarts/gantt', path:'gantt',
name:'Gantt', name:'Gantt',
meta:{}, meta:{title:'甘特图'},
component:() => import('@/views/Echarts/GanttChart.vue') component:() => import('@/views/Echarts/GanttChart.vue')
} }
] ]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册