0👍
I’m guessing your app structure looks like the following:
new Vue({
el: '#app',
data: [{ "id": 1, "name": "Lorem Ipsum Name","address": "Lorem Ipsum Street" }]
})
I don’t think you can grab array values directly off the data object like that in Vue. Try changing it to this:
new Vue({
el: '#app',
data: {
"data": [{ "id": 1, "name": "Lorem Ipsum Name","address": "Lorem Ipsum Street" }]
}
})
This fiddle is helpful to experiment with: https://jsfiddle.net/chrisvfritz/50wL7mdz/
0👍
You can get the data object property with $data
.
So you can do the following(https://jsfiddle.net/tenkz5j9/3/):
<p>{{ $data[0].id }}</p>
- [Vuejs]-How to constraint a route with a specific role in my case with vue-auth?
- [Vuejs]-Vuex/Firestore retrieve user data from another collection
Source:stackexchange.com