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

    [Solved] Pls help me understand the Quasar `App.vue` vs the `real root Vue`!

    Help
    2
    2
    1304
    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.
    • mesqueeb
      mesqueeb last edited by mesqueeb

      So I understand that this is the root vue instance:

      window.vm = new Vue({
          el: '#q-app',
          store,
          router,
          render: h => h(require('./App'))
        })
      })
      

      This is a vue component “pretending” to be the root:

      <template>
        <!-- Don't drop "q-app" class -->
        <div id="q-app">
                <router-view></router-view>
        </div>
      </template>
      <script>
      /*
       * Root component
       */
      export default {
      	data() {
      		return {
      			dataTest: "this is not the real ROOT data!!!! It's a fake root",
      		}
      	},
      }
      </script>
      

      But what I don’t understand is that this “component” pretending to be a root can use the same id →  <div id="q-app"> as the real root component…

      How is this possible?

      Because the index.html also includes this:

        <body>
          <div id="q-app"></div>
       </body>
      
      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        See Razvan’s answer here: http://forum.quasar-framework.org/topic/447/clarification-on-default-template-correct-app-vue-layout

        Scott

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