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-tab-panel as element inside q-tab-panels not displaying.

    Help
    2
    4
    582
    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.
    • F
      Fedack last edited by

      I’m trying to dynamically add q-tab-panels that I have added as an element but they do not show.

      <template>
        <q-tab-panel :name="this.tabName">
          <div class="text-h6">{{tabName}}</div>
          {{tabDescription}}
        </q-tab-panel>
      </template>
      
      <script>
      export default {
        name: 'GameTab',
        props: ['tabName', 'tabDescription'],
        data () {
          return {
      
          }
        },
        methods: {
      
        }
      }
      </script>
      

      Above is my element, below is what I’m trying to put it in.

      <template>
        <q-layout view="hHh lpr fFr" style="min-height: inherit">
          <q-drawer v-model="right" side="right" bordered>
            <q-list bordered separator>
              <GameMenuLinks tabName="Mails" v-on:tabChange="tabChange" />
              <GameMenuLinks tabName="Alarms" v-on:tabChange="tabChange" />
              <GameMenuLinks tabName="Movies" v-on:tabChange="tabChange" />
            </q-list>
          </q-drawer>
          <q-tab-panels v-model="tab" animated>
            <GameTab
              tabName="Mails"
              tabDescription="Lorem ipsum dolor sit amet consectetur adipisicing elit."
            />
          </q-tab-panels>
          <q-page-sticky position="bottom-right" :offset="[18, 18]">
            <q-btn @click="toggleDrawer" square color="accent" icon="list" />
          </q-page-sticky>
        </q-layout>
      </template>
      <script>
      // import WindowWatcher from './WindowWatcher'
      import GameMenuLinks from './GameMenuLinks'
      import GameTab from './GameTab'
      export default {
        data () {
          return {
            tab: 'Mails',
            width: 0,
            right: false
          }
        },
        name: 'Game',
        components: {
          // WindowWatcher
          GameMenuLinks,
          GameTab
        },
        methods: {
          onResize (size) {
            this.width = size.width
          },
          toggleDrawer () {
            this.right = !this.right
          },
          tabChange (value) {
            this.tab = value
          }
        }
      }
      </script>
      
      <style lang="stylus" scoped></style>
      
      

      I cannot see why they aren’t showing. The same process worked for the GameMenuLinks.
      Any idea?

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

        U cant refer this in the template.

        1 Reply Last reply Reply Quote 0
        • F
          Fedack last edited by

          Even without this it didn’t work. I’m using a v-for instead now and I’m putting an element inside the q-tab-panel generated by the v-for loop. So I’ve got it working with the workaround. Thanks.

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

            @Fedack can you make a repro codesandbox pls. looks like not a quasar issue at glance but a vue one :/.

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