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 open <q-context-menu>

    Help
    1
    1
    541
    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.
    • J
      joefly last edited by joefly

      In the docs, the following example for <q-context-menu> is provided:

          <div ref="target" style="height: 100px; width: 100px; background-color: purple">
            <q-context-menu ref="context">
              <q-list link separator style="min-width: 150px; max-height: 300px;">
                <q-item @click="showToast(), $refs.context.close()">
                  <q-item-main label="Label" sublabel="Value"></q-item-main>
                </q-item>
                <q-item @click="showOtherToast(), $refs.context.close()">
                  <q-item-main label="Other Label" sublabel="Other Value"></q-item-main>
                </q-item>
              </q-list>
            </q-context-menu>
          </div>
      

      However, I cannot figure out how to open the context menu.

      EDIT: I got it!! I had to wrap the q-context-menu in a div with ref=“target”. Then right clicking on the div opens the context menu. I changed the code above to reflect the solution.

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