1axios.get('/user/1').then((response) => {
2 console.log('Everything is awesome.');
3}).catch((error) => {
4 console.warn('Not good man :(');
5})
1new Vue({
2 el: '#app',
3 data () {
4 return {
5 info: null,
6 loading: true,
7 errored: false
8 }
9 },
10 filters: {
11 currencydecimal (value) {
12 return value.toFixed(2)
13 }
14 },
15 mounted () {
16 axios
17 .get('https://api.coindesk.com/v1/bpi/currentprice.json')
18 .then(response => {
19 this.info = response.data.bpi
20 })
21 .catch(error => {
22 console.log(error)
23 this.errored = true
24 })
25 .finally(() => this.loading = false)
26 }
27})