Multiple sidebar in Vue Sidebar component

16 Mar 20234 minutes to read

Two Sidebars can be initialized in a web page with same main content. Sidebars can be initialized on right side or left side of the main content using position property.

The HTML element with class name e-main-content will be considered as the main content and both the Sidebars will behave as side content to this main content area.

<div id="app">
        <ejs-sidebar id="default" ref="leftsidebar" :width="leftWidth" :type="leftType">
          <div class="title"> Left Sidebar content</div>

        <ejs-sidebar id="default1" ref="rightsidebar" :width="width"  :position="position"
           <div class="title">Right Sidebar content</div>
    <div class="e-main-content">
           <p>Place your main content here.....</p>
        <div id="button-align">
            <button ejs-button id="toggle" class="e-btn e-info" v-on:click="leftToggle">Toggle Sidebar1</button>
        <div id="button-align">
          <button ejs-button id="toggle2" class="e-btn e-info" v-on:click="rightToggle">Toggle Sidebar2</button>
import Vue from 'vue';
import { SidebarPlugin } from '@syncfusion/ej2-vue-navigations';
import { ButtonPlugin } from '@syncfusion/ej2-vue-buttons';
import { enableRipple } from '@syncfusion/ej2-base';

export default {
       data () {
          return {
         leftWidth: '250px'
         leftType: 'Push'
         width : '250px',
         position: 'Right',
         type: 'Push'
     methods: {
        leftToggle :function() {
        rightToggle: function() {
@import "../node_modules/@syncfusion/ej2-vue-navigations/styles/material.css";

    text-align: center;
    height: 100vh;
    background: #f5f5f5;
    font-size: 16px;
    padding: 100px;

    padding: 15px;

.title {
    text-align: center;
    font-size: 20px;
    padding: 15px;

#default,#default1 {
    background-color: rgb(25, 118, 210);
    color: #ffffff;
    overflow: hidden;