PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, October 17, 2022

[FIXED] How to make a side panel in a component with Quasar Vue Framework 14.3

 October 17, 2022     javascript, quasar-framework, vue-component, vue.js     No comments   

Issue

I have a working left side panel using Quasar version 14.3. Now I want to make it a component. When I use this:

<template>
  <q-layout ref="layout"
            :left-breakpoint=0>

    <q-scroll-area slot="left" style="width: 80%; height: 100%>
      <div>
        <left-panel></left-panel>
      </div>
    </q-scroll-area>
  </q-layout>
</template>

It kind of works, however:

  • the width gives css issues
  • do I really have to keep the q-scroll-area out of the component? When I include it the side panel does not hide but is in the page and then the actual page is below it when you scroll down.

Any suggestion to how to make a solid side panel in a component with Quasar?


Solution

You can use q-layout-drawer for creating the left panel in q-layout

<template>
  <q-layout ref="layout" :left-breakpoint=0>
    <q-layout-drawer v-model="flag" side="left">
      <q-scroll-area slot="left" style="width: 80%; height: 100%">
        <div>
          <left-panel></left-panel>
        </div>
      </q-scroll-area>
    </q-layout-drawer>
  </q-layout>
</template>

Set flag true in data of Vue component.You can also open/close drawer on button click by setting flag true false



Answered By - Patel Pratik
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing