Accessing Object inside Array

前端 未结 3 1053
挽巷
挽巷 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:06

    If you want get only author try it:

    var postDetails = [{
      author: "John",
      category: "Tech"
    }];
    
    var inner = postDetails.map(function(e) {
      return e.autor;
    });
    
    console.log(inner);

提交回复
热议问题