nativescript-vue/nativescript-vue.org

Unable to pass props to custom component inside a <Listview />

Dineshkumarraman opened this issue · 1 comments

Here is my code

 <ListView for="listDetail in listDetails" style="height: 850px">
                <v-template>
                    <FlexboxLayout flexDirection="column" class="list-group-item">
                    	<ListComponent :listData="listDetail", :listJsonData="listJsonData", :listIndex="index" />
                    </FlexLayout>
                </v-template>            
            </ListView> 

listData(object), listJsonData(array), listIndex(number) are ListComponent props.
listDetails(array of objects), listJsonData(Object) are data of the parent class.
In ListComponent listData value becomes default instead of object.

This is the wrong repository, but looking at your code, index is not defined, you need to use either $index or change the list iterator to for="(listDetail, index) in listDetails" to be able to use just index. The rest looks good based on what you've provided here.