A
A
Alex_872021-01-08 00:15:42
Vue.js
Alex_87, 2021-01-08 00:15:42

How to find out what object we are in?

Hello! Question next!
In data I have an array of objects, which I output using the v-for directive. Each object has a name field, and depending on what is in the name field, I want to run a specific function. How to determine which field has which name and check it with if? What to write in the condition?
Code link: https://codesandbox.io/s/hardcore-bush-3bnpd?file=...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-01-08
@Alex_87

If I understood everything correctly, then you just need to pass an object to the function.
It is better to do the check after the input, so either hang a function on focusout or add the lazy modifier. @input.lazy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question