Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dinamyc props in form schema #547

Open
alfredobp opened this issue May 24, 2022 · 1 comment
Open

Dinamyc props in form schema #547

alfredobp opened this issue May 24, 2022 · 1 comment
Labels
feature request New feature or request

Comments

@alfredobp
Copy link

Hello. Is there any way to pass a list of values ​​to a type select input that comes from a request to an API rest response?
Currently, I have a form like this:

`
[{
"component": "h3",
"children": "Migrar un sitio"
},

{
	"label": "Nombre de la instalación",
	"name": "name",
	"validation": "required"
},
{
	"type": "autocomplete",
	"label": "list",
	"name": "list",
	"validation": "required",
	"label": "Search for a hosting domain",
	"options": [

{
"value": 1,
"label": "xxx"
},
{
"value": 2,
"label": "Jane Roe"
},
{
"value": 3,
"label": "Bob Foe"
},
{
"value": 4,
"label": "Ben Cho"
}
]

}, {
	"type": "submit",
	"label": "Aplicar Migración"
}

]`

I have a custom component: autocomplete, following the official documentation.

It´s works fine, but I don't want to have to do this in the json Schema. If not pass a variable in vue.js with the data array.

"options": [{ "value": "--", "label": "---" }, { "value": "webempresa", "label": "WebEmpresa" }, { "value": "dinahosting", "label": "Dinahosting" }, { "value": "arsys", "label": "Arsys" } ],

Thanks for the help

@alfredobp alfredobp added the feature request New feature or request label May 24, 2022
@hacknug
Copy link

hacknug commented Jul 18, 2022

You should probably use a computed property that returns your schema using whatever other property has your API response with the options you want to use. This could differ depending on your current implementation of the API fetch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants