1

I am trying to get the object on itemTap in a ListView. I want to be able to have access to the name and age of the object. But I can't figure out how to do this in the onItemTap function

data

listOfItems: [{name: "Tom", age: 55}, {name:"Greg", age: 32}]

template

<ListView for="item in listOfItems" @itemTap="onItemTap($event)">
  <v-template>
    <Label :text="item.text" />
  </v-template>
</ListView>

methods

onItemTap: function(args) {
  ???
}
1
  • Any updates, news? Commented Aug 19, 2019 at 8:15

1 Answer 1

1

See the docs

Template

<ListView for="item in listOfItems" @itemTap="onItemTap">
  <v-template>
    <!-- Shows the list item label in the default color and style. -->
    <Label :text="item.text" />
  </v-template>
</ListView>

Methods

onItemTap(event) {
  console.log(event.index)
  console.log(event.item)
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.