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 link a q-item to an external link?

    Help
    2
    4
    2453
    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.
    • A
      abeltodev last edited by

      I need to link a full q-item to an external link.

      With <a> tag is not working properly (losing clickable areas or hover styles).

      A click event should do the trick but I am unable to handle this.

      What can I do?

      Thanks 🙂

      1 Reply Last reply Reply Quote 0
      • A
        abeltodev last edited by

        I’ve solved by using the native event. Like this:

        <q-item @click.native="…">

        1 Reply Last reply Reply Quote 1
        • Hawkeye64
          Hawkeye64 last edited by

          If it makes it easier, you can do the following:
          HTML:

                        <q-item  class="link" @click.native="onClick(prop.node.link)">
                          <q-item-side :icon="prop.node.icon" color="teal-6" size="18px" >
                            {{ prop.node.name }}
                          </q-item-side>
                        </q-item>
          

          SCRIPT:

          import { openURL } from 'quasar'
          

          METHOD:

              onClick: function (link) {
                openURL(link)
              }
          
          1 Reply Last reply Reply Quote 0
          • A
            abeltodev last edited by

            That’s what I did: use the native event …

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