No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to close sidemenu on clicking a list item inside side menu

    Framework
    2
    5
    1738
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rashidnk last edited by

      Im a beginner in quasar, how to close sidemenu on clicking an list item?

      <q-item v-for=“chapt in chapterlist” @click=“chaptSelected=chapt.value”>
      <q-item-side icon=“school” />
      <q-item-main v-bind:label=“chapt.label” sublabel=“quasar-framework.org” />
      </q-item>

      1 Reply Last reply Reply Quote 0
      • benoitranque
        benoitranque last edited by benoitranque

        take a look at this and this

        Also, supposing you are using a layout and have a reference to it, do this

          // set a reference of 'layout'. could also be 'my-layout', 'bestlayout', etc
          <q-layout ref="layout">
            <div slot="left">
             // use reference you set earlier
              <span @click="$refs.layout.hideLeft()">any item will do</span>
            </div>
          </q-layout>
        
        1 Reply Last reply Reply Quote 0
        • R
          rashidnk last edited by

          how to do this if i want to call a function

          @click=“myFunction()”

          where to put this $refs.layout.hideLeft() ?

          benoitranque 1 Reply Last reply Reply Quote 0
          • benoitranque
            benoitranque @rashidnk last edited by

            @rashidnk

            ...
            <q-layout ref="layout">
              <!-- Content goes here -->
            </q-layout>
            ...
            methods: {
              myFunction () {
                this.$refs.layout.hideLeft()
              }
            }
            

            This assumes you are doing this in one .vue file. Reply if you need to access this method from a descendant component of the q-layout

            R 1 Reply Last reply Reply Quote 0
            • R
              rashidnk @benoitranque last edited by

              @benoitranque thank you, i will try this one

              1 Reply Last reply Reply Quote 0
              • First post
                Last post