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

    q-route-tab problem

    Help
    3
    6
    1905
    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.
    • alienspaces
      alienspaces last edited by

      Hi there,

      I must be missing something really simple but I just cannot seem to get the q-route-tab to work.

      Here are my routes:

      const routes = [
        {
          path: '/',
          component: () => import('layouts/Admin.vue'),
          children: [
            {
              path: '',
              component: () => import('pages/Index.vue')
            },
            {
              path: 'blah',
              component: () => import('pages/Blah.vue')
            }
          ]
        }
      ]
      

      Here is my layout:

       <q-layout-header>
            <q-tabs>
              <q-route-tab
                slot="title"
                icon="home"
                to="/"
                exact
              />
              <q-route-tab
                slot="title"
                icon="apps"
                to="/blah"
                exact
              />
            </q-tabs>
      
            <router-link to="/">Go to Home</router-link>
            <router-link to="/blah">Go to Blah</router-link>
      
          </q-layout-header>
      

      Clicking the tabs results in highlighting and underlining of the tabs as expected however the route does not change, the content does not change from the index page to the blah page…

      Clicking a router-link results in highlighting and underlining of the tabs as expected and the route does change!

      Any ideas why my clicking the tabs does not work but clicking the links does?

      Thanks.

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

        try removing exact props.

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

          @metalsadman Thanks for the reply, unfortunately that did not work.

          I tested q-tabs / q-route-tab in Safari on macOS and everything is working as expected so this looks like a problem with Chrome on macOS High SIerra / Chrome Version 71.0.3578.98.

              Dev mode.......... spa
              Quasar theme...... mat
              Quasar CLI........ v0.17.22
              Quasar Framework.. v0.17.18
          
          1 Reply Last reply Reply Quote 0
          • syflex
            syflex last edited by

            Use a named route. That is more effective.
            Add name: ‘Index’, and name: ‘Blah’ in your route file. And access it using:
            :to="{name: ‘Index’}"
            :to="{name: ‘Blah’}"

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

              Thanks @syflex for your suggestion, while using named routes continues to work in Safari this did not resolve the problem with Chrome on macOS. I’ll dig deeper!

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

                Resolved.

                I don’t know why but when I disabled Vuejs devtools q-tabs/q-route-tab began to work as expected. I then re-enabled Vuejs devtools and the functionality continued to work as expected.

                Thanks for your help!

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