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
    1. Home
    2. kelly7
    3. Posts
    K
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Groups 0

    Posts made by kelly7

    • RE: Q-route-tab with Q-tab-panel: how to set active tab

      @beets Thank you. But this didn’t work.😢

      posted in Help
      K
      kelly7
    • Q-route-tab with Q-tab-panel: how to set active tab

      I have a button, for jumping to the Q-tab-panels layout, and I made it jumping to the first tab’s page.

      <q-btn round @click="toUser()" unelevated>
      //script
      toUser(){
            this.$router.push({
              name: 'UserInfo',
              params:{ uId: this.uId}
            })
          },
      
      {
              path:'/user',
              component: () => import('layouts/UserLayout'),
              children: [
                {
                  name: 'UserInfo',
                  path: '/user/info/:uId',
                  component: () => import('pages/User/UserInfo')
                },
          ]
      }
      
      <!--the layout page-->
      <q-page>
          <q-splitter
            v-model="splitterModel"
          >
            <template v-slot:before style="width: 30%">
              <q-tabs
                  v-model="routeName"
                  vertical
                  class="text-blue-grey-13"
                  active-color="blue-grey-14"
                >
                  <q-route-tab v-for="r in routeList" :key="r.name" :name="r.name"
                               :to="{name: r.name, params:r.params}" :icon="r.icon" :label="r.label" />
              </q-tabs>
            </template>
      
            <template v-slot:after>
              <q-tab-panels v-model="routeName">
                <q-tab-panel :name="routeName">
                  <router-view />
                </q-tab-panel>
              </q-tab-panels>
            </template>
          </q-splitter>
        </q-page>
      //script
      computed: {
          routeName() {
            return this.$route.name
          },
      }
      

      I clicked the button- the page content was right, but the first tab was not active. Only after I clicking a tab, that tab became active.
      I want to make the first tab active when I click the button.
      Thank you very much.

      posted in Help
      K
      kelly7