index.html
<!DOCTYPE html>
<html lang="">
<form>
<label>Enter Currency: <input type="text"></label>
<input type="submit" value="Submit">
</form>
</html>
app.vue
<script>
//eslint-disable-next-line no-unused-vars
import axios from 'axios'
export default {
data: () => ({
cryptos: [],
errors: []
}),
created () {
axios.get('https://api.coinbase.com/v2/prices/spot?currency=EUR')
.then(response => {
this.cryptos = response.data
console.log(response)
})
.catch(e => {
this.errors.push(e)
})
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
I got the following code in Vue.js and I want when I press Submit Button refresh the page and return the console.log(Response). I tried using this code but it returns me blank page even though when I go to chrome console I can see that the Values of Response are there but How can I display them to the page ?