I'm having difficulty listing the values of a Json, but the result of it is an array inside an array as you can see below;
{
"status": true,
"valores": {
"USD": {
"nome": "D\u00f3lar",
"valor": 3.2789,
"ultima_consulta": 1521232205,
"fonte": "UOL Economia - http:\/\/economia.uol.com.br\/"
},
"EUR": {
"nome": "Euro",
"valor": 4.0303,
"ultima_consulta": 1521428406,
"fonte": "UOL Economia - http:\/\/economia.uol.com.br\/"
},
"ARS": {
"nome": "Peso Argentino",
"valor": 0.1627,
"ultima_consulta": 1521428407,
"fonte": "UOL Economia - http:\/\/economia.uol.com.br\/"
},
"GBP": {
"nome": "Libra Esterlina",
"valor": 4.572,
"ultima_consulta": 1521428407,
"fonte": "UOL Economia - http:\/\/economia.uol.com.br\/"
},
"BTC": {
"nome": "Bitcoin",
"valor": 26500,
"ultima_consulta": 1521455704,
"fonte": "Mercado Bitcoin - http:\/\/www.mercadobitcoin.com.br\/"
}
}
}
Based on this Json link
Json values = > click here
I'm following this tutorial
To list the values I did this test, but I had no results;
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<title>teste</title>
<link rel="stylesheet" type="text/css" href="node_modules/bootstrap/dist/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="node_modules/font-awesome/css/font-awesome.css"/>
</head>
<body>
<div class="container" id="app">
<div class="row">
</div>
<div class="row">
<ol>
<li v-for="bancodedado in bancodedados">
{{ bancodedado.valores }}
<ul>
<li v-for="usd in valores.USD" >
{{ usd.valor }}
</li>
</ul>
</li>
</ol>
</div>
</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script src="node_modules/vue-resource/dist/vue-resource.js"></script>
<script >
var app = new Vue({
el: '#app',
data: {
bancodedados: []
},
methods: {
},
created: function() {
var self = this;
self.$http.get('http://api.promasters.net.br/cotacao/v1/valores').then(function(response) {
self.bancodedados = response.body.results;
});
},
});
===================================================== =======
I tried this and could not, and I did not succeed.
<ol>
<li v-for="( bandodedado, key) in bancodedados ">
<ul>
<li>
<li>
{{ key }} : {{ bandodedado }}
</li>
</li>
</ul>
</li>
</ol>
Can anyone tell me how to list the array values?