修改: 代码规范;

master
iczer 5 years ago
parent 19c48c7a30
commit 54e6a72f3a
  1. 2
      src/components/menu/menu.js
  2. 10
      src/components/setting/Setting.vue
  3. 12
      src/layouts/MenuView.vue
  4. 6
      src/layouts/PageView.vue
  5. 6
      src/layouts/RouteView.vue
  6. 6
      src/store/modules/setting.js

@ -19,7 +19,7 @@
* ] * ]
**/ **/
import Menu from 'ant-design-vue/es/menu' import Menu from 'ant-design-vue/es/menu'
import Icon from 'ant-design-vue/es/icon/' import Icon from 'ant-design-vue/es/icon'
const {Item, SubMenu} = Menu const {Item, SubMenu} = Menu

@ -57,7 +57,7 @@
</a-list-item> </a-list-item>
<a-list-item> <a-list-item>
多页签模式 多页签模式
<a-switch :checked="multipage" slot="actions" size="small" @change="setMultipage" /> <a-switch :checked="multiPage" slot="actions" size="small" @change="setMultiPage" />
</a-list-item> </a-list-item>
</a-list> </a-list>
</setting-item> </setting-item>
@ -79,8 +79,8 @@ export default {
name: 'Setting', name: 'Setting',
components: {ImgCheckboxGroup, ImgCheckbox, ColorCheckboxGroup, ColorCheckbox, SettingItem}, components: {ImgCheckboxGroup, ImgCheckbox, ColorCheckboxGroup, ColorCheckbox, SettingItem},
computed: { computed: {
multipage () { multiPage () {
return this.$store.state.setting.multipage return this.$store.state.setting.multiPage
} }
}, },
methods: { methods: {
@ -103,8 +103,8 @@ export default {
clipboard.destroy() clipboard.destroy()
}) })
}, },
setMultipage (checked) { setMultiPage (checked) {
this.$store.commit('setting/setMultipage', checked) this.$store.commit('setting/setMultiPage', checked)
} }
} }
} }

@ -3,7 +3,7 @@
<contextmenu :itemList="menuItemList" :visible.sync="menuVisible" @select="onMenuSelect" /> <contextmenu :itemList="menuItemList" :visible.sync="menuVisible" @select="onMenuSelect" />
<a-tabs <a-tabs
@contextmenu.native="e => onContextmenu(e)" @contextmenu.native="e => onContextmenu(e)"
v-if="multipage" v-if="multiPage"
:active-key="activePage" :active-key="activePage"
style="margin-top: -8px; margin-bottom: 8px" style="margin-top: -8px; margin-bottom: 8px"
:hide-add="true" :hide-add="true"
@ -15,7 +15,7 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<transition name="page-toggle"> <transition name="page-toggle">
<keep-alive v-if="multipage"> <keep-alive v-if="multiPage">
<router-view /> <router-view />
</keep-alive> </keep-alive>
<router-view v-else /> <router-view v-else />
@ -43,8 +43,8 @@ export default {
} }
}, },
computed: { computed: {
multipage () { multiPage () {
return this.$store.state.setting.multipage return this.$store.state.setting.multiPage
} }
}, },
created () { created () {
@ -55,7 +55,7 @@ export default {
watch: { watch: {
'$route': function (newRoute) { '$route': function (newRoute) {
this.activePage = newRoute.fullPath this.activePage = newRoute.fullPath
if (!this.multipage) { if (!this.multiPage) {
this.linkList = [newRoute.fullPath] this.linkList = [newRoute.fullPath]
this.pageList = [newRoute] this.pageList = [newRoute]
} else if (this.linkList.indexOf(newRoute.fullPath) < 0) { } else if (this.linkList.indexOf(newRoute.fullPath) < 0) {
@ -66,7 +66,7 @@ export default {
'activePage': function (key) { 'activePage': function (key) {
this.$router.push(key) this.$router.push(key)
}, },
'multipage': function (newVal) { 'multiPage': function (newVal) {
if (!newVal) { if (!newVal) {
this.linkList = [this.$route.fullPath] this.linkList = [this.$route.fullPath]
this.pageList = [this.$route] this.pageList = [this.$route]

@ -4,7 +4,7 @@
<img :src="extraImage"/> <img :src="extraImage"/>
</div> </div>
<transition name="page-toggle"> <transition name="page-toggle">
<keep-alive v-if="multipage"> <keep-alive v-if="multiPage">
<router-view ref="page" /> <router-view ref="page" />
</keep-alive> </keep-alive>
<router-view ref="page" v-else /> <router-view ref="page" v-else />
@ -26,8 +26,8 @@ export default {
} }
}, },
computed: { computed: {
multipage () { multiPage () {
return this.$store.state.setting.multipage return this.$store.state.setting.multiPage
} }
}, },
mounted () { mounted () {

@ -1,6 +1,6 @@
<template> <template>
<transition name="page-toggle"> <transition name="page-toggle">
<keep-alive v-if="multipage"> <keep-alive v-if="multiPage">
<router-view /> <router-view />
</keep-alive> </keep-alive>
<router-view v-else /> <router-view v-else />
@ -11,8 +11,8 @@
export default { export default {
name: 'RouteView', name: 'RouteView',
computed: { computed: {
multipage () { multiPage () {
return this.$store.state.setting.multipage return this.$store.state.setting.multiPage
} }
} }
} }

@ -11,7 +11,7 @@ export default {
{link: 'https://github.com/iczer/vue-antd-admin', icon: 'github'}, {link: 'https://github.com/iczer/vue-antd-admin', icon: 'github'},
{link: 'https://ant.design', name: 'Ant Design'} {link: 'https://ant.design', name: 'Ant Design'}
], ],
multipage: true multiPage: true
}, },
mutations: { mutations: {
setDevice (state, isMobile) { setDevice (state, isMobile) {
@ -23,8 +23,8 @@ export default {
setLayout (state, layout) { setLayout (state, layout) {
state.layout = layout state.layout = layout
}, },
setMultipage (state, multipage) { setMultiPage (state, multiPage) {
state.multipage = multipage state.multiPage = multiPage
} }
} }
} }

Loading…
Cancel
Save