update sidebar and logout

This commit is contained in:
AceDataCloud committed 2021-09-15 02:06:28 +08:00
1 parent 63b38f177b
commit 6df9472cf7
7 files changed
+42 -10

No files matched your search

+6 -7
View File
@@ -9,18 +9,17 @@ body {
}
#app {
background-color: #f5f5f5;
.el-menu {
border-right: none;
}
background-color: #f8f9fe;
.el-card {
border: none;
border-radius: 12px;
word-wrap: break-word;
border-radius: 0.375rem;
border: 1px solid rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2rem 0 rgba(136, 152, 170, 0.15) !important;
}
.el-menu-item.is-active {
background-color: var(--el-menu-item-hover-fill);
// background-color: var(--el-menu-item-hover-fill);
}
.el-breadcrumb__inner a,
+2
View File
@@ -0,0 +1,2 @@
// $--color-primary: #5e72e4;
@import 'element-plus/packages/theme-chalk/src/index';
+1
View File
@@ -1 +1,2 @@
@import './element';
@import './common';
+20 -1
View File
@@ -17,7 +17,14 @@
}}</el-button>
</div>
<div class="mt-3 pr-10 float-right" v-else>
<img :src="$store.getters.user?.avatar" class="avatar" />
<el-dropdown trigger="click">
<img :src="$store.getters.user?.avatar" class="avatar" />
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="onLogout">{{ $t('common.button.logout') }}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</el-col>
</el-row>
@@ -51,6 +58,10 @@ export default defineComponent({
this.$router.push({
name: 'login'
});
},
onLogout() {
this.$store.dispatch('resetAuth');
this.$router.push('/');
}
}
});
@@ -75,6 +86,14 @@ export default defineComponent({
}
.el-main {
padding: 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
.el-menu {
.el-menu-item {
&.is-active {
border-bottom: 3px solid var(--el-color-primary);
}
}
}
}
.avatar {
height: 40px;
+11
View File
@@ -43,3 +43,14 @@ export default defineComponent({
}
});
</script>
<style lang="scss" scoped>
.el-menu {
border-right: 1px solid rgba(0, 0, 0, 0.05);
.el-menu-item {
&.is-active {
border-left: 3px solid var(--el-color-primary);
}
}
}
</style>
+2 -1
View File
@@ -1,5 +1,6 @@
export default {
setup: '配置',
edit: '编辑',
login: '登录'
login: '登录',
logout: '退出登录'
};
-1
View File
@@ -6,6 +6,5 @@ import ElementPlus from 'element-plus';
import i18n from './i18n/index';
import './assets/css/tailwind.css';
import './assets/scss/style.scss';
import 'element-plus/dist/index.css';
createApp(App).use(router).use(store).use(ElementPlus).use(i18n).mount('#app');