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-spinner consumes CPU even when invisible

    Framework
    2
    3
    93
    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
      SaleCar last edited by

      Hello,

      I have an Q-spinner in the toolbar to show when the content is loading but when the spinner is inactive, it still consumes cpu resources.

      What is the best way to implement a spinner so that the animation does not consume cpu resources if it is not visible?

      Here’s what I tried and it didn’t help:

      <div :hidden="!loading">
          <q-spinner-oval color="primary" size="2em" />
      </div>
      
      <q-spinner-oval 
          :class="{ invisible : !loading }" 
          color="primary" 
          size="2em" 
      />
      
      <q-spinner-oval 
          :class="{ hidden : !loading }" 
          color="primary" 
          size="2em" 
      />
      
      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @SaleCar last edited by metalsadman

        @salecar try using v-if as it destroys the component and recreates it depending on the boolean. ie.

        <q-spinner-oval 
            v-if="loading"
            color="primary" 
            size="2em" 
        />
        
        1 Reply Last reply Reply Quote 0
        • S
          SaleCar last edited by

          Thanks, it works!

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