I have tried to call API using Axios in vue.js app, API called successfully but the value is not affected. I wanted to set value which returns from the API response.
Vue.js code
new Vue({
el: '#app',
data () {
return {
info: null
}
},
mounted () {
axios
.get('https://api.coindesk.com/v1/bpi/currentprice.json')
.then(response => (this.info = response))
}
})
HTML code
<script src="https://unpkg.com/vue"></script>
<div id="app">
{{ info }}
</div>