nuxt: Don't see the loading / progress bar at the top

Version

v2.9.1

Reproduction link

http://www.nourl.com

Steps to reproduce

With an installation of nuxt / nuxt-edge, I don’t see the loading / progress bar at the top.

According to this doc, the loading indicator should be enabled by default, but it isn’t. https://nuxtjs.org/api/configuration-loading#disable-the-progress-bar

I also tried this in nuxt.config.js:

  loading: { color: "#f00" },

What is expected ?

Loading / progress bar indicator should show up

What is actually happening?

It does not.

<div align="right">This bug report is available on Nuxt community (#c9665)</div>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@andreynazarov3 if you want to attach another method to mounted without overwriting the original one, use an array:

// plugins/cookie.js
export default ({ app, store }) => {
  app.mounted = [app.mounted, function () {
    ... some code
  }];
};

Hello I need help.

I need send data to the default layout from any child component.

please contact me.

if you want to make loading animation in nuxtjs, this below code will help you.

<template>
    <div v-if="loading" class="loading-gif-style">
         <img src="loading.gif" class="loading-image-gif-style" width="15%" />
    </div>
    <div v-else-if="!loading">
          <p> backend data loading Success.</p>
    </div>
</template>

<script>
import axios from "axios";
import apiService from "~/apiService";

export default {
  name: "blog-list",
  data: function() {
    return {
      loading: true,
    };
  },

  created: function() {    
    let sendData = {
      method: "get",
      url: this.geturl,
      data: null
    };
    apiService(sendData, response => {
       if(response.data.status == 200){
              this.loading= false;
            }
    });
  }
</script>

<style scoped>
.loading-gif-style{
    width: 100%'
    height: 100%;
    background: white;
     z-index: 999;
    position: absolute;
    opacity: 0.5 ;
}
.loading-image-gif-style{
   position: absolute;
  top: 40%;
  left: 40%;
   z-index: 1000;
}

</style>

When you use this code, If you conflict any issue, let me know. I will help you anytime. Thanks. Best Regards.

Still have this problem. It seems to be of a “throttle” problem. Add this and see if this work. loading: { color: “#ff5757”, height: “4px”, throttle: 0 },