【发布时间】:2021-09-22 00:23:41
【问题描述】:
这是我的代码。
export default {
components: {
draggable,
},
data() {
return {
ethPrice: null,
};
},
mounted() {
axios
.get(
"https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd"
)
.then((response) => (this.ethPrice = response.data));
反应是
{ "ethereum": { "usd": 2037.4 } }
这是我做的模板。
<v-card-text>{{ ethPrice }}</v-card-text>
我如何才能进入“ethereum”,然后进入“usd”并只获取值?
【问题讨论】:
标签: vue.js vuejs2 axios vuetify.js