美文网首页Vue.js
Vue-element-admin侧边栏在页面缩小后去掉图标显示

Vue-element-admin侧边栏在页面缩小后去掉图标显示

作者: kingLeft7 | 来源:发表于2020-10-21 16:36 被阅读0次

    项目中希望页面缩小后,还是二图,不显示图标


    image.png
    image.png
    /找到store/modules/app.js文件
    const app = {
      state: {
        sidebar: {
          // opened: !+Cookies.get('sidebarStatus'),        //原值
          opened:true,                                      //默认展开(false是隐藏)
          withoutAnimation: false
        },
        device: 'desktop',
        language: Cookies.get('language') || 'en',
        size: Cookies.get('size') || 'medium'
      },
      mutations: {
        TOGGLE_SIDEBAR: state => {            //点击收缩功能触发
          // if (state.sidebar.opened) {
          //   Cookies.set('sidebarStatus', 1)
          // } else {
          //   Cookies.set('sidebarStatus', 0)
          // }
          // state.sidebar.opened = !state.sidebar.opened
          state.sidebar.opened = true
          state.sidebar.withoutAnimation = false
        },
        CLOSE_SIDEBAR: (state, withoutAnimation) => {        //自适应触发
          Cookies.set('sidebarStatus',1)
          state.sidebar.opened = true
          state.sidebar.withoutAnimation = withoutAnimation
        }
    }
    

    相关文章

      网友评论

        本文标题:Vue-element-admin侧边栏在页面缩小后去掉图标显示

        本文链接:https://www.haomeiwen.com/subject/enremktx.html