Accessing Object inside Array

前端 未结 3 1033
挽巷
挽巷 2021-01-15 14:40

I\'m trying to access values inside Firebase array > object.

When I try to access values inside v-for, it works well. But I cannot do this: postDetail.author. It re

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-15 15:24

    Since postDetail is an array of object to access properties inside its objects, you need do something like postDetail[Index].prop

    var postDetail =[{"author" : "abc", "meta" : "xyz"}];
    console.log(postDetail[0].author);

提交回复
热议问题