Multi-level Sidebar Menu Component For Vue.js

Description:

An easy to use multi-level sidebar navigation component designed for Vue.js dashboard applications.

How to use it:

1. Install & import the component.

import Vue from 'vue'
import VueSidebarMenu from 'vue-sidebar-menu'
import 'vue-sidebar-menu/dist/vue-sidebar-menu.css'
Vue.use(VueSidebarMenu)
// or
import { SidebarMenu } from 'vue-sidebar-menu'
export default {
  components: {
    SidebarMenu
  }
}

2. Create a basic sidebar navigation on the app.

<template>
  <sidebar-menu :menu="menu" />
</template>
<script>
  export default {
      data() {
          return {
              menu: [
                  {
                      header: true,
                      title: 'Main Navigation',
                      hiddenOnCollapse: true
                  },
                  {
                      href: '/1',
                      title: 'Menu 1',
                      icon: 'ICON CLASS HERE'
                  },
                  {
                      href: '/2',
                      title: 'Menu 2',
                      icon: 'ICON CLASS HERE',
                      child: [
                          {
                              href: '/2-1',
                              title: 'Menu 2-1'
                          }
                      ]
                  }
              ]
          }
      }
  }
</script>

3. Possible props.

// Sidebar menu (required)
menu: {
  type: Array,
  required: true
},
// Sidebar Collapse state
collapsed: {
  type: Boolean,
  default: false
},
// Sidebar width (expanded)
width: {
  type: String,
  default: '350px'
},
// Sidebar width (collapsed)
widthCollapsed: {
  type: String,
  default: '50px'
},
// Keep only one child opened at a time (first level only)
showOneChild: {
  type: Boolean,
  default: false
},
// Keep all child open
showChild: {
  type: Boolean,
  default: false
},
// Sidebar right to left
rtl: {
  type: Boolean,
  default: false
},
// Make sidebar relative to the parent (by default the sidebar is relative to the viewport)
relative: {
  type: Boolean,
  default: false
},
// Hide toggle collapse btn
hideToggle: {
  type: Boolean,
  default: false
},
// Sidebar theme (available themes: 'white-theme')
theme: {
  type: String,
  default: ''
},
// Disable hover on collapse mode
disableHover: {
  type: Boolean,
  default: false
}

Preview:

Multi-level Sidebar Menu Component For Vue.js

Changelog:

v4.6.2 (07/24/2020)

  • dist build

v4.6.1 (07/02/2020)

  • fix clickEvent on touch device

Download Details:

Author: yaminncco

Live Demo: https://yaminncco.github.io/vue-sidebar-menu/#/page

Download Link: https://github.com/yaminncco/vue-sidebar-menu/archive/master.zip

Official Website: https://github.com/yaminncco/vue-sidebar-menu

Install & Download:

# Yarn
$ yarn add vue-sidebar-menu

# NPM
$ npm install vue-sidebar-menu --save

You Might Be Interested In:

Tags:

Add Comment