vue-admin icon indicating copy to clipboard operation
vue-admin copied to clipboard

Disable the sidebar for the specific view [documentation request]

Open talatccan opened this issue 7 years ago • 2 comments

Hello,

How can i disable the sidebar for specific view? I could not find any documentation about this.

Thanks.

talatccan avatar Jun 13 '17 00:06 talatccan

Yes, sidebar can be hidden by setting app.sidebar.hidden to true.

I just commit my changes to export this functionality

Now you can hide sidebar by using these codes.

import action from vuex

import { mapActions } from 'vuex'

and

methods: {
 ...mapActions([
  'toggleSidebar'
 ]),
 // your methods
}

then call toggleSidebar with param {hidden: true} to hide sidebar.

this.toggleSidebar({hidden: true})

luventa avatar Jun 20 '17 10:06 luventa

it just hide for sidebar area but sidebar ui is not hide. I add this ---> state.sidebar.opened = !config.hidden .

client\store\modules\app.js

const mutations = {
  [types.TOGGLE_DEVICE] (state, device) {
    state.device.isMobile = device === 'mobile'
    state.device.isTablet = device === 'tablet'
  },

  [types.TOGGLE_SIDEBAR] (state, config) {
    if (state.device.isMobile && config.hasOwnProperty('opened')) {
      state.sidebar.opened = config.opened
    } else {
      state.sidebar.opened = true
    }

    if (config.hasOwnProperty('hidden')) {
      state.sidebar.hidden = config.hidden
      ---> state.sidebar.opened = !config.hidden
    }
  },

  [types.SWITCH_EFFECT] (state, effectItem) {
    for (let name in effectItem) {
      state.effect[name] = effectItem[name]
    }
  }
}

Juckky00 avatar Dec 24 '17 23:12 Juckky00