Answer the question
In order to leave comments, you need to log in
Is it possible to pass parameters in a loop?
Hello.
I want to ask if it is possible to output the parameters that I pass to the props in the loop.
For example:
[
{
componentName:Button,
title: Кнопка,
label: : Желтая кнопка
},
{
componentName:Select,
options:[1,2] ,
type:select
},
]
Answer the question
In order to leave comments, you need to log in
Move all parameters to a separate object:
[
{
name: 'componentName1',
props: {
propName1: ...,
propName2: ...,
},
},
{
name: 'componentName2',
props: {
propName69: ...,
propName187: ...,
propName666: ...,
},
},
...
]
<component
v-for="n in componentsData"
v-bind="n.props"
:is="n.name"
/>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question