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

    QRouteTab: Appending routes correctly

    Help
    1
    1
    1007
    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.
    • arjanski
      arjanski last edited by

      I seem to have a problem understanding the routing neccessary for q-route-tab. I would like each tab content to load another component via routing and append the url (“parent-url/tab1”, “parent-url/tab2”). Loading components works using child routes and router-view in q-layout, but only for the first tab selected. Once I have routed to let’s say parent-url/tab1, and select a different tab (tab2), the url gets appended on top of the tab1 child url, resulting in parent-url/tab1/tab2. This leads to a 404…

      Any ideas what I am doing wrong?

      Template of ParentComponent.vue:

       <template>
         <q-layout>
              ...
                <div slot="navigation">
                ...
                  <q-tabs color="purple" inverted align="center">
                     <q-route-tab
                       default="true"
                       label="Integralansicht"
                       to="tab1"
                       append
                       slot="title"
                       color="purple"
                   />
                <q-route-tab
                  label="Leseansicht"
                  to="tab2"
                  append
                  slot="title"
                  color="purple"
                />
                <q-route-tab
                  label="Transkript"
                  to="tab3"
                  append
                  slot="title"
                  color="purple"
                />
          </q-tabs>
        </div>
      
        <router-view />
      
       </q-layout>
      <template>
      

      My route.js looks as follows:

          {
            path: 'parent-url',
            component: load('pages/editions/EditionView'),
            children: [
              {
                path: 'tab1',
                component: load('pages/editions/ViewmodeIntegral')
              },
              {
                path: 'tab2',
                component: load('pages/editions/ViewmodeReader')
              },
              {
                path: 'tab3',
                component: load('pages/editions/ViewmodeTranscript')
              },
              {
                path: 'tab4',
                component: load('pages/editions/ViewmodeFacsimile')
              }
            ]
          }
      

      `

      Thanks a lot for any ideas!

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