mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-06 15:31:23 +08:00
Added save menu expanded state
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
:active-text-color="COLOR_PRODUCTION()"
|
:active-text-color="COLOR_PRODUCTION()"
|
||||||
>
|
>
|
||||||
<el-menu-item
|
<el-menu-item
|
||||||
@mousedown.left="isCollapsed = !isCollapsed"
|
@mousedown.left="changeCollapsed"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
style="cursor: pointer; opacity: 1; border-bottom: 1px #ddd solid"
|
style="cursor: pointer; opacity: 1; border-bottom: 1px #ddd solid"
|
||||||
>
|
>
|
||||||
@@ -178,13 +178,14 @@ import {
|
|||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { getUser, getUsername, logout } from '@/utils/auth'
|
import { getUser, getUsername, logout } from '@/utils/auth'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { getLocalStorage, setLocalStorage } from '@/utils/common'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MainFrame',
|
name: 'MainFrame',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
routes: [],
|
routes: [],
|
||||||
isCollapsed: false,
|
isCollapsed: getLocalStorage('menuCollapsed') === 'true',
|
||||||
username: ''
|
username: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -216,6 +217,10 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$router.push({ name: 'Login' })
|
this.$router.push({ name: 'Login' })
|
||||||
}, 1500)
|
}, 1500)
|
||||||
|
},
|
||||||
|
changeCollapsed() {
|
||||||
|
this.isCollapsed = !this.isCollapsed
|
||||||
|
setLocalStorage('menuCollapsed', this.isCollapsed.toString())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
Reference in New Issue
Block a user