代码优化
This commit is contained in:
@@ -23,11 +23,6 @@
|
|||||||
<el-switch v-model="sidebarLogo" class="drawer-switch" />
|
<el-switch v-model="sidebarLogo" class="drawer-switch" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="drawer-item">
|
|
||||||
<span>菜单UniqueOpened</span>
|
|
||||||
<el-switch v-model="uniqueOpened" class="drawer-switch" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -73,17 +68,6 @@ export default {
|
|||||||
value: val
|
value: val
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
uniqueOpened: {
|
|
||||||
get() {
|
|
||||||
return this.$store.state.settings.uniqueOpened
|
|
||||||
},
|
|
||||||
set(val) {
|
|
||||||
this.$store.dispatch('settings/changeSetting', {
|
|
||||||
key: 'uniqueOpened',
|
|
||||||
value: val
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
:collapse="isCollapse"
|
:collapse="isCollapse"
|
||||||
:background-color="variables.menuBg"
|
:background-color="variables.menuBg"
|
||||||
:text-color="variables.menuText"
|
:text-color="variables.menuText"
|
||||||
:unique-opened="$store.state.settings.uniqueOpened"
|
|
||||||
:active-text-color="variables.menuActiveText"
|
:active-text-color="variables.menuActiveText"
|
||||||
:collapse-transition="false"
|
:collapse-transition="false"
|
||||||
|
unique-opened
|
||||||
mode="vertical"
|
mode="vertical"
|
||||||
>
|
>
|
||||||
<sidebar-item v-for="route in sidebarRouters" :key="route.path" :item="route" :base-path="route.path" />
|
<sidebar-item v-for="route in sidebarRouters" :key="route.path" :item="route" :base-path="route.path" />
|
||||||
|
|||||||
@@ -19,10 +19,6 @@ module.exports = {
|
|||||||
* @description 记住密码状态下的密码在Cookie中存储的天数,默认1天s
|
* @description 记住密码状态下的密码在Cookie中存储的天数,默认1天s
|
||||||
*/
|
*/
|
||||||
passCookieExpires: 1,
|
passCookieExpires: 1,
|
||||||
/**
|
|
||||||
* @description 是否只保持一个子菜单的展开
|
|
||||||
*/
|
|
||||||
uniqueOpened: true,
|
|
||||||
/**
|
/**
|
||||||
* @description token key
|
* @description token key
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import variables from '@/assets/styles/element-variables.scss'
|
import variables from '@/assets/styles/element-variables.scss'
|
||||||
import defaultSettings from '@/settings'
|
import defaultSettings from '@/settings'
|
||||||
const { tagsView, fixedHeader, sidebarLogo, uniqueOpened, showFooter, footerTxt, caseNumber } = defaultSettings
|
const { tagsView, fixedHeader, sidebarLogo, showFooter, footerTxt, caseNumber } = defaultSettings
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
theme: variables.theme,
|
theme: variables.theme,
|
||||||
@@ -8,7 +8,6 @@ const state = {
|
|||||||
tagsView: tagsView,
|
tagsView: tagsView,
|
||||||
fixedHeader: fixedHeader,
|
fixedHeader: fixedHeader,
|
||||||
sidebarLogo: sidebarLogo,
|
sidebarLogo: sidebarLogo,
|
||||||
uniqueOpened: uniqueOpened,
|
|
||||||
showFooter: showFooter,
|
showFooter: showFooter,
|
||||||
footerTxt: footerTxt,
|
footerTxt: footerTxt,
|
||||||
caseNumber: caseNumber
|
caseNumber: caseNumber
|
||||||
|
|||||||
Reference in New Issue
Block a user