Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Added loading progress bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvcayetano committed Sep 21, 2019
1 parent 518a554 commit e469482
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gvc.ClientApp/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
loading: { color: '#ff8c00' },
/*
** Global CSS
*/
Expand Down
12 changes: 8 additions & 4 deletions Gvc.ClientApp/pages/about.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@
},
methods: {
async getSocialMediaLinks() {
this.socialMediaLinks = await this.$axios.$get('/api/about')
this.socialMediaLinks = await this.$axios.$get('/api/about', { progress: true })
}
},
mounted() {
this.getSocialMediaLinks();
}
mounted () {
this.$nextTick(() => {
this.$nuxt.$loading.start();
this.getSocialMediaLinks();
setTimeout(() => this.$nuxt.$loading.finish(), 500);
})
}
}
</script>

Expand Down
6 changes: 6 additions & 0 deletions Gvc.ClientApp/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
return {
title: 'GVC - Software Engineer - MCSD'
}
},
mounted() {
this.$nextTick(() => {
this.$nuxt.$loading.start();
setTimeout(() => this.$nuxt.$loading.finish(), 500);
})
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion Gvc.Web/VueHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class VueHelper
// default port number of 'npm run serve'
private static int Port { get; } = 3000;
private static Uri DevelopmentServerEndpoint { get; } = new Uri($"http://localhost:{Port}");
private static TimeSpan Timeout { get; } = TimeSpan.FromSeconds(30);
private static TimeSpan Timeout { get; } = TimeSpan.FromMinutes(1);
// done message of 'npm run serve' command.
private static string DoneMessage { get; } = "DONE Compiled successfully in";

Expand Down

0 comments on commit e469482

Please sign in to comment.