Is there a way to transform an array into a list of objects?
Transform
[
{
"currenttime":43481.46983805556,
"moped":"30 minutes",
"car":"1 hour"
}
]
to
{
"currenttime":43481.46983805556,
"moped":"30 minutes",
"car":"1 hour"
}
The data is fetched from an external source and then manipulated using Vue.js
<script type="text/javascript>
const app = new Vue({
el: '#app',
data: {
items: []
},
created: function() {
fetch('https://example.com/delivery.json')
.then(resp => resp.json())
.then(items => {
this.items = items
})
}
});
</script>
I attempted to display the content using {{ items.car }}
and {{ items.0.car }}
, but it did not work as expected