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

    root app's component

    Help
    2
    3
    63
    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.
    • G
      gregor87 last edited by

      I want to modify my root app’s component as code below. How can I reach same behaviour in boot file?

      store.dispatch('auth/loginAttempt', localStorage.getItem('token'))
          .then(() => {
              const app = new Vue({
                  el: '#app',
                  i18n,
                  router,
                  store,
                  components: {
                      App
                  }
              });
          })
      
      1 Reply Last reply Reply Quote 0
      • beets
        beets last edited by

        @gregor87 I’m not really sure you can, but the boot function can be async, so you should be able to just await the store action

        1 Reply Last reply Reply Quote 1
        • G
          gregor87 last edited by

          Indeed, this solves the issue

          export default async ({ Vue, store }) => {
          await store.dispatch(‘auth/loginAttempt’, localStorage.getItem(‘token’))
          };

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