C
C
chumak_pro2019-09-12 03:54:53
Vue.js
chumak_pro, 2019-09-12 03:54:53

How to specify a variable?

I have an array with data that is loaded via axios.
I need to show the otvet block in each data block by clicking on otvet_b.
Creating 10 or 20 variables is not an option, since the array always has a different amount of data
How to implement this correctly?
Quite green in the view, thanks for the help,
5d799759e5fd1128313242.jpeg
just a regular variable is not an option to use, since visibility will also change in all other blocks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Suha, 2019-09-12
@chumak_pro

A separate boiler is waiting for the picture code. According to the subject, in such cases you make a separate component and change the state inside it. Those. you will have a word component in which there will already be one variable, but for each instance it has its own

R
Robur, 2019-09-12
@Robur

btn_otvet[key]
if key is not an index, then btn_answer must be an object, not an array

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question