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

    Call a function when the Loading Bar is displayed / hidden

    Framework
    axios button loading-bar
    1
    2
    266
    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.
    • O
      Oxi last edited by Oxi

      Hello, everyone,

      I’ve discovered Quasar for myself and I’m excited. Now I’m hoping you can help me solve a problem.

      I start an Axios call with a button click. The Loading Bar appears properly. But I’d like to disable the Send button until the Axios call is complete.

      Since I’m using a Mixin, I can’t write the Disable function directly into the Axios call. My idea is to respond to the appearance of the Loading Bar. Or do you have a better idea?

      Best regards
      Oxi

      <q-btn
          color="primary"
          icon="cloud"
          label="Load list"
           v-bind:loading="submitting"
           v-on:click="startAxiosCall"
      />
      

      Idea: The variable “submitting” should be set to true as long as the loading bar is displayed.

      The Docs say, there is already an event triggered:
      aa949249-738f-4d0c-ac13-e11febd9bf0c-image.png

      Unfortunately, I don’t know how to react to it or intercept it or anything like that.

      1 Reply Last reply Reply Quote 0
      • O
        Oxi last edited by

        I figured it out myself 🙂

        The Ajax-Bar had to be integrated and the event had to be written in it.

        https://quasar.dev/start/how-to-use-vue#Handling-Vue-Events
        https://quasar.dev/vue-components/ajax-bar#Usage

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