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 go to an external site when clicking on a drawer link item

    Help
    7
    14
    10115
    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
      april last edited by april

      Hi guys,

      I’d like to display a link to an external site on my left drawer. What is the best way of doing this?

      The screenshot below shows what I was trying to do. When clicking on the “Blog” button, I want to make it go to the blog site. How can I achieve this?

      0_1495695155636_Screen Shot 2017-05-25 at 10.40.07 AM.png

      I tried this code below and it didn’t work for my case.

      <q-drawer-link icon=“exit_to_app” :to="{path: ‘http://blog.mydomain.com’, exact: true}" >
      Blog
      </q-drawer-link>


      Update:
      I edited the original question to clarify that I wanted to go to an external site.

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by s.molinari

        Quasar uses vue-router to form the q-drawer-links. So, you need to form your routes in vue-router definitions, then your links will work.

        https://router.vuejs.org/en/
        https://github.com/quasarframework/quasar-template-default/blob/master/template/src/router.js

        This is the router in the play-app, just for more examples.

        https://github.com/quasarframework/quasar-play/blob/dev/src/router.js

        Scott

        1 Reply Last reply Reply Quote 0
        • s.molinari
          s.molinari last edited by

          Ah, and if you are trying to link to an external page/ site, then just use a normal href.

          Scott

          A 1 Reply Last reply Reply Quote 0
          • A
            april @s.molinari last edited by april

            @s.molinari
            Thanks for answering my question. Yes, I’m trying to link to an external site. Can you give an example how I may use the normal href in the context of the drawer link?

            1 Reply Last reply Reply Quote 0
            • s.molinari
              s.molinari last edited by

              Um, what in particular do you want to know? It’s just a normal <a> tag.

              Scott

              A 1 Reply Last reply Reply Quote 0
              • A
                april @s.molinari last edited by april

                @s.molinari
                A normal <a> tag would look ugly on the drawer. I would need to have my own custom styling for it to look like other q-drawer-link elements. I was trying see if there was a clean way.

                1 Reply Last reply Reply Quote 0
                • s.molinari
                  s.molinari last edited by

                  Yeah. You’ll have to add your own css to format the links.

                  Scott

                  1 Reply Last reply Reply Quote 0
                  • s.molinari
                    s.molinari last edited by

                    Actually, there is a better solution.

                    http://quasar-framework.org/api/js-utils.html#Open-External-URL

                    Scott

                    A S 2 Replies Last reply Reply Quote 1
                    • A
                      april @s.molinari last edited by

                      @s.molinari
                      Thank you! I will have a look at this later.

                      1 Reply Last reply Reply Quote 0
                      • D
                        danielo515 last edited by

                        The provided links points to nowhere

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

                          @danielo515 The docs structure changed, here is the new link: http://quasar-framework.org/components/other-utils.html#Open-External-URL

                          1 Reply Last reply Reply Quote 1
                          • D
                            dylanglockler last edited by

                            Must have changed again: https://quasar.dev/quasar-utils/other-utils#Open-External-URL

                            1 Reply Last reply Reply Quote 0
                            • S
                              Serhioromano @s.molinari last edited by

                              @s-molinari That is cook one. Thank you.

                              1 Reply Last reply Reply Quote 0
                              • E
                                eyedean last edited by

                                It seems like <q-btn type="a" href="https://www.google.com">Go to Google</q-btn> works. 🙂 I gut the hint from the Open-External-URL's documentation.

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