Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
VueJs: API call in mounted very slow

in my Vue js project i have problem with API data, the page loads fast but data from API takes more than 5 sec to load. However, my Api response is very fast in console. in below code i implemented api in other file called API services and i put a class that contains all my APIs called BuildingService, so i called API on mounted and it loads slow can any one help me in this?

<script>
  import Vue from 'vue'
  import BuildingsService from "@/services/ApiService"

  Vue.use(VueClipboard)
  export default {
    data(){
      return{
buildings:[],

      }
    },
    name: 'icons',
    components: {
      BaseHeader
    },
  
    mounted:function(){
          BuildingsService.getBuildings().then((response) => {
      this.buildings = response.data.response;
      console.log(response.data.response,"dd");

    });
    }

   
   
          
      
  };
</script>
 
              <b-col lg="3" md="6"  v-for="(building, index) in buildings"
              :key="index" >
>{{building.building_number}}
   
              </b-col>
         

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use created instead of mounted:

created() {
      BuildingsService.getBuildings().then((response) => {
      this.buildings = response.data.response;
      console.log(response.data.response,"dd");
    });
}

for reference: enter link description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!