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

    Usage of q-page

    Framework
    4
    5
    242
    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.
    • S
      stn-swz last edited by

      I would like to know is it possible to use q-page directly within the MainLayout like this:

      <!-- vue file for Layout (e.g. MainLayout.vue) -->
      <q-layout>
        ...
        <q-page-container>
          <q-page>
            <router-view />
          </q-page>
        </q-page-container>
        ...
      </q-layout>
      

      I tried it and it works well. So for me it seems to be easier using it directly in MainLayout, because then q-page should be used automaticaly for every page. But has it any drawback?

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

        yeah, since it’s a child of q-page-container.

        1 Reply Last reply Reply Quote 0
        • W
          walfin last edited by

          Well, what if you need multiple elements in the same q-page? Cuz each component can only have one root element.

          I suppose you could wrap it in a div instead, but why not just make q-page the root element?

          dobbel 1 Reply Last reply Reply Quote 0
          • dobbel
            dobbel @walfin last edited by

            @walfin because you may want to declare the page and it’s properties once and not for every page.

            In the upcoming Vue3 you can have multiple root elements.

            1 Reply Last reply Reply Quote 0
            • S
              stn-swz last edited by

              Thanks, thats what i wanted to know.
              @dobbel Yes, thats the case. I just want to declare it once and not in every single page.

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