[Vuejs]-Can a component be found using its key?

0👍

You can’t query a component using the key in the findComponent() method.

But you can fetch all components within your list, and then filter them like a regular array.
Just provide the right condition to find the item you want (usings its props, attrs or whatever)

const items = wrapper.findAllComponents(MyListItem)
const foundItem = items.wrappers.find(listItem => list.props('id') === 'theIdILookFor')

Leave a comment