'v-repeat'를 사용할 때 'post.letter'를 볼 수 있지만 동일한 'v-repeat'에서 posts 배열을 반복해야하는 것 같습니다.
'post.posts.title'을 시도하면 아무것도 얻지 못하고 'post.posts'를하면 [object, object]가 표시됩니다.
var myObj = [
{
post: {
letter: 'A',
posts: [
{ title: 'lorem ipsum'},
{ title: 'dolor sit amet'}
],
}
}
];
원하는 것을 올바르게 이해하고 있다면 별칭을 사용할 수 있습니다.
<h4>{{ post.letter }}</h4>
<ul>
<li v-repeat="subPost : post.posts"> {{ subPost.title }}</li>
</ul>
도움이 되었기를 바랍니다!
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다