You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.9 KiB

<template>
5 years ago
<el-container>
5 years ago
<el-header height="80" class="home-header-view">
<el-row type="flex" align="middle">
5 years ago
<el-col :span="4" :offset="1">
5 years ago
<img src="@/assets/images/indexLogo.png" class="header-logo-img"
@click="$router.push({path:'/project/create'})"
>
</el-col>
5 years ago
<el-col :span="10">
<el-menu :default-active="menuIndex" mode="horizontal" :router="true" text-color="#205BB5"
active-text-color="#205BB5"
>
<el-menu-item v-for="(item, index) in menuRouters" :key="index" :index="item.routerPath"
5 years ago
:route="item.routerPath" class="menu-item"
>
{{ item.title }}
</el-menu-item>
</el-menu>
5 years ago
<!-- <span v-for="(item, index) in menuRouters" :key="index"-->
<!-- class="menu-item"-->
<!-- @click="activeMenuHandle(item.routerPath)"-->
<!-- >-->
<!-- {{ item.title }}-->
<!-- </span>-->
</el-col>
5 years ago
<el-col :span="1">
<el-button round>升级</el-button>
</el-col>
<el-col :span="1">
5 years ago
<div style="display: flex; align-items: center; justify-content: center;">
<svg-icon name="loginWx" style="width: 24px; height: 24px;" />
</div>
</el-col>
<el-col :span="1">
<el-link href="https://element.eleme.io" target="_blank">帮助</el-link>
</el-col>
<el-col :span="3">
5 years ago
<div style="display: flex; align-items: center; justify-content: center;">
<img :src="getUserInfo.avatar" style="width: 50px; height: 50px; border-radius: 100px;">
</div>
</el-col>
</el-row>
</el-header>
5 years ago
<el-main style="padding: 2px;">
5 years ago
<router-view />
</el-main>
</el-container>
</template>
<script>
import store from '@/store/index.js'
export default {
name: 'Home',
data() {
return {
menuIndex: null,
menuRouters: [
{
routerPath: '/proposal',
5 years ago
title: '免费模板'
},
{
routerPath: '/sources',
title: '开源项目'
},
{
routerPath: '/enterprise',
title: '提出建议'
}
]
}
},
computed: {
getStore() {
return store
},
getUserInfo() {
return JSON.parse(this.getStore.getters['user/userInfo'])
}
},
watch: {
$route(to) {
this.menuIndex = to.path
}
},
mounted() {
this.menuIndex = this.$route.path
5 years ago
},
methods: {
activeMenuHandle(routerPath) {
this.menuIndex = routerPath
}
}
}
</script>
5 years ago
<style lang="scss" scoped>
.menu-item {
5 years ago
line-height: 80px;
height: 80px;
text-align: left;
font-weight: 550;
5 years ago
color: rgba(32, 91, 181, 100);
font-size: 20px;
&:hover {
cursor: pointer;
}
}
.el-menu.el-menu--horizontal {
border-bottom: none;
}
5 years ago
.home-header-view {
line-height: 90px;
height: 80px;
background-color: rgba(255, 255, 255, 100);
color: rgba(16, 16, 16, 100);
font-size: 14px;
text-align: center;
5 years ago
.header-logo-img {
width: 225px;
height: 62px;
float: left;
}
}
</style>