Skip to content

Commit

Permalink
优化细节
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBai007 committed Nov 29, 2018
1 parent ade24e1 commit a7f2d9d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default {
<style lang="less">
// 这里是坑啊,文件路径中好像不能用@符号
// 引入全局样式
@import "./assets/styles/global.less";
@import "./assets/less/global.less";
</style>
File renamed without changes.
4 changes: 1 addition & 3 deletions src/components/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h3 class="logo">
<span class="rythm twist1">{{toggSiderBar ? 'VUE': 'AUTO VUE'}}</span>
</h3>
<el-menu background-color="#324157" text-color="#ddd" :default-active="$route.path" :unique-opened="isUnique" :router="isRouter" mode="vertical" :collapse="toggSiderBar">
<el-menu background-color="#324157" text-color="#ddd" :default-active="$route.path" :unique-opened="true" :router="true" mode="vertical" :collapse="toggSiderBar">
<template v-for="item in menu">
<el-submenu v-if="item.children.length !== 0" :index="item.router" :key="item.router">
<template slot="title">
Expand Down Expand Up @@ -63,8 +63,6 @@ export default {
data() {
return {
isMusicOn: false,
isUnique: true,
isRouter: true,
menu: localStorage.menu ? JSON.parse(localStorage.menu) : []
};
},
Expand Down
12 changes: 6 additions & 6 deletions src/components/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<i class="fa fa-language" title="切换语言" @click="toggleLanguage"></i>
</el-col>
<el-col :span="2">
<i class="fa fa-arrows-alt" title="切换全屏" @click="toggleFullscreen"></i>
<i :class="[isFullscreen? 'fa-compress': 'fa-arrows-alt','fa ']" title="切换全屏" @click="toggleFullscreen"></i>
</el-col>
<el-col :span="3">
<i class="fa fa-sign-out logout" title="退出" @click.prevent="logout"></i>
Expand All @@ -32,7 +32,8 @@ export default {
name: 'topbar',
data() {
return {
userName: localStorage.userName || ''
userName: localStorage.userName || '',
isFullscreen: false
}
},
computed: {
Expand All @@ -52,13 +53,12 @@ export default {
},
toggleFullscreen() {
if (!screenfull.enabled) {
this.$message({
message: '您的浏览器不支持全屏',
type: 'warning'
})
this.$message.warning('您的浏览器不支持全屏')
return false
}
screenfull.toggle()
// isFullscreen 居然是反的
this.isFullscreen = !screenfull.isFullscreen
},
logout() {
localStorage.clear()
Expand Down

0 comments on commit a7f2d9d

Please sign in to comment.