|
@@ -1,61 +1,37 @@
|
|
|
<template>
|
|
|
<div id="native">
|
|
|
<el-row>
|
|
|
- <!-- <el-menu :default-active="activeIndex" mode="horizontal" background-color="#850000" text-color="#fff" active-text-color="#fff" :router="true">
|
|
|
- <template v-for="(item, index) in menuList">
|
|
|
- <el-submenu v-if="item.children.length > 0" :index="`${index}`" :key="index">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect"
|
|
|
+ background-color="#336699" text-color="#fff" active-text-color="#fff" style="height:40px;" :router="true">
|
|
|
+ <el-menu-item index="/">首页</el-menu-item>
|
|
|
+ <!-- 循环菜单↓ -->
|
|
|
+ <template v-for="(item, index) in menu">
|
|
|
+ <el-submenu :index="`${index}`" :key="index" v-if="item.type !== 'url' && item.type !== 'content'">
|
|
|
+ <!-- 输出一级栏目↓ -->
|
|
|
<template slot="title">
|
|
|
- {{ item.name }}
|
|
|
+ {{ item.title }}
|
|
|
+ </template>
|
|
|
+ <template v-for="(sub, subIndex) in item.children">
|
|
|
+ <el-submenu :index="`${index}-${subIndex}`" :key="subIndex+'sub'" v-if="sub.children">
|
|
|
+ <template slot="title">
|
|
|
+ {{ sub.title }}
|
|
|
+ </template>
|
|
|
+ <template v-for="(thr,thrIndex) in sub.children">
|
|
|
+ <el-menu-item :index="thr.path" :key="thrIndex+'thr'" v-if="thr.type !== 'url'">{{ thr.title }}</el-menu-item>
|
|
|
+ <el-menu-item :index="``" :key="thrIndex+'thr'" @click="turnTo(thr.url)" v-else> {{ thr.title }}</el-menu-item>
|
|
|
+ </template>
|
|
|
+ </el-submenu>
|
|
|
+ <el-menu-item :index="sub.path" :key="subIndex+'sub'" v-else-if="sub.type === 'content'||sub.type==='column'">{{ sub.title }}</el-menu-item>
|
|
|
+ <el-menu-item :index="`${index}-${subIndex}`" :key="subIndex+'sub'" @click="turnTo(sub.url)" v-else> {{ sub.title }}</el-menu-item>
|
|
|
</template>
|
|
|
- <el-menu-item v-for="(sub, subIndex) in item.children" :key="subIndex" :index="sub.path">{{ sub.name }}</el-menu-item>
|
|
|
</el-submenu>
|
|
|
- <el-menu-item v-else :index="item.path" :key="index">{{ item.name }}</el-menu-item>
|
|
|
+ <!-- 一级栏目非常规栏目情况 -->
|
|
|
+ <el-menu-item v-else-if="item.type === 'content'" :index="item.path" :key="index">{{ item.title }}</el-menu-item>
|
|
|
+ <el-menu-item v-else :index="``" :key="index" @click="turnTo(item.url)">{{ item.title }}</el-menu-item>
|
|
|
+ <!-- 输出一级栏目结束↑ -->
|
|
|
</template>
|
|
|
- </el-menu> -->
|
|
|
- <el-col :span="24">
|
|
|
- <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect"
|
|
|
- background-color="#336699" text-color="#fff" active-text-color="#fff" style="height:40px;">
|
|
|
- <el-menu-item index="1">首页</el-menu-item>
|
|
|
- <el-submenu index="2">
|
|
|
- <template slot="title">新闻资讯</template>
|
|
|
- <el-menu-item index="2-1">科技要闻</el-menu-item>
|
|
|
- <el-menu-item index="2-2">学术资讯</el-menu-item>
|
|
|
- <el-menu-item index="2-3">工作动态</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-submenu index="3">
|
|
|
- <template slot="title">起算服务</template>
|
|
|
- <el-submenu index="3-1">
|
|
|
- <template slot="title">?起算</template>
|
|
|
- <el-menu-item index="3-1-1">资源介绍</el-menu-item>
|
|
|
- <el-menu-item index="3-1-2">账号申请</el-menu-item>
|
|
|
- <el-menu-item index="3-1-3">计算登录</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-submenu index="3-2">
|
|
|
- <template slot="title">运行动态</template>
|
|
|
- <el-menu-item index="3-2-1">起算应用</el-menu-item>
|
|
|
- <el-menu-item index="3-2-2">应用领域</el-menu-item>
|
|
|
- <el-menu-item index="3-2-3">应用案例</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-menu-item index="3-3">成果讲堂</el-menu-item>
|
|
|
- <el-menu-item index="3-4">AI社区</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-submenu index="4">
|
|
|
- <template slot="title">成果展示</template>
|
|
|
- <el-menu-item index="2-1">成果展示</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-submenu index="5">
|
|
|
- <template slot="title">交流互动</template>
|
|
|
- <el-menu-item index="5-1">技术研讨</el-menu-item>
|
|
|
- <el-menu-item index="5-2">技术问答</el-menu-item>
|
|
|
- <el-menu-item index="5-3">教育培训</el-menu-item>
|
|
|
- <el-menu-item index="5-4">行业研究</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- <el-submenu index="6">
|
|
|
- <template slot="title">党建学苑</template>
|
|
|
- <el-menu-item index="6-1">党建工作</el-menu-item>
|
|
|
- <el-menu-item index="6-2">学习用地</el-menu-item>
|
|
|
- <el-menu-item index="6-3">廉政建设</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
+ <!-- 循环菜单结束↑ -->
|
|
|
</el-menu>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -65,20 +41,29 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: 'native',
|
|
|
- props: {
|
|
|
- // menuList: null,
|
|
|
- },
|
|
|
+ props: {},
|
|
|
components: {},
|
|
|
data: () => ({
|
|
|
- activeIndex2: '1'
|
|
|
+ activeIndex2: '',
|
|
|
+ menu:[],
|
|
|
}),
|
|
|
- created() { },
|
|
|
+ created() {
|
|
|
+ this.getMenu();
|
|
|
+ },
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
handleSelect(key, keyPath) {
|
|
|
- // eslint-disable-next-line no-console
|
|
|
console.log(key, keyPath);
|
|
|
- }
|
|
|
+ },
|
|
|
+ getMenu(){
|
|
|
+ let menu = sessionStorage.getItem('menu');
|
|
|
+ if(menu) {
|
|
|
+ this.$set(this, `menu`, JSON.parse(menu));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ turnTo(url) {
|
|
|
+ window.open(url);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|