Skip to content

Instantly share code, notes, and snippets.

@KenoLeon
Created June 17, 2020 19:57
Show Gist options
  • Select an option

  • Save KenoLeon/220511303766c0a1dd0b67b9ad027e94 to your computer and use it in GitHub Desktop.

Select an option

Save KenoLeon/220511303766c0a1dd0b67b9ad027e94 to your computer and use it in GitHub Desktop.
Vue json call from App parent
<script>
import jQuery from 'jquery';
let $ = jQuery;
export default {
name: 'App',
components: {
tableComponent,
chartComponent
},
created : function(){
var _this = this;
// Using Jquery, you could use something else, note that your response is going to be different,
// here it returns a chartLeaderboard and tableLeaderboard but yours is probably different
// If you want to further modify your response this is a good place to do so.
//
$.getJSON('https://YOUR_API_URL', function (data) {
_this.chartData = data.charLeaderboard
_this.tableData = data.tableLeaderboard
})
},
data() {
return {
chartData = []
tableData = []
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment