Browse Source

菜单页按钮判断增加

master
aBin 3 years ago
parent
commit
cb4a8edf2c
  1. 6
      src/store/modules/user.js
  2. 9
      src/views/layout/Layout.vue

6
src/store/modules/user.js

@ -13,7 +13,8 @@ const user = {
roles: [], roles: [],
setting: { setting: {
articlePlatform: [] articlePlatform: []
} },
perList: [],
}, },
mutations: { mutations: {
@ -40,6 +41,9 @@ const user = {
}, },
SET_ROLES: (state, roles) => { SET_ROLES: (state, roles) => {
state.roles = roles state.roles = roles
},
SET_PER_LIST: (state, perList) => {
state.perList = perList
} }
}, },

9
src/views/layout/Layout.vue

@ -11,7 +11,9 @@
<script> <script>
import { Navbar, Sidebar, AppMain, TagsView } from './components' import { Navbar, Sidebar, AppMain, TagsView } from './components'
import { GET_ALL_HAVE } from '@/api/jurisdiction'
import ResizeMixin from './mixin/ResizeHandler' import ResizeMixin from './mixin/ResizeHandler'
import { mapMutations } from 'vuex'
export default { export default {
name: 'Layout', name: 'Layout',
@ -39,8 +41,15 @@ export default {
} }
}, },
methods: { methods: {
...mapMutations('SET_PER_LIST'),
handleClickOutside() { handleClickOutside() {
this.$store.dispatch('closeSideBar', { withoutAnimation: false }) this.$store.dispatch('closeSideBar', { withoutAnimation: false })
},
getPerList() {
GET_ALL_HAVE({}).then(res => {
console.log(res)
})
} }
} }
} }

Loading…
Cancel
Save