Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Vue demo1 minimize sidebar


Hi,

I want to minimize the sidebar by default, I've tried many things and it didn't work. How should I update my config?


import type LayoutConfigTypes from "@/layouts/default-layout/config/types";

const config: LayoutConfigTypes = {
general: {
mode: "system",
primaryColor: "#50CD89",
pageWidth: "default",
layout: "light-sidebar",
iconsType: "outline",
},
header: {
display: true,
default: {
container: "fluid",
fixed: { desktop: false, mobile: false },
menu: { display: true, iconType: "keenthemes" },
},
},
sidebar: {
display: true,
default: {
minimize: {
desktop: { enabled: true, default: false, hoverable: true },
},
menu: { iconType: "keenthemes" },
},
},
toolbar: {
display: true,
container: "fluid",
fixed: { desktop: false, mobile: false },
},
pageTitle: { display: true, breadcrumb: true, direction: "column" },
content: { container: "fluid" },
footer: {
display: true,
container: "fluid",
fixed: { desktop: false, mobile: false },
},
illustrations: { set: "sketchy-1" },
scrolltop: { display: true },
};

export default config;


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


thnx, this worked



Hi,

Thank you for reaching out to us.

To make sidebar minimized by default follow the steps below:
1) Navigate demo1/src/core/services/LayoutService.ts and in function initSidebar add the following code, which will add attribute data-kt-app-sidebar-minimize="on" on body tag to hide sidebar.

this.bodyStore.addBodyAttribute({
qualifiedName: "data-kt-app-sidebar-minimize",
value: "on",
});

2) In file demo1/src/layouts/default-layout/components/sidebar/SidebarLogo.vue add active class on the sidebar toggle button.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(