We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
Thank you for adding the ability to overwrite the form tag field!
Would it be possible to pass additional option data? Specifically to use within the custom vue template? This would be really powerful. For example:
Multiselect::make('Football teams') ->options([ 'liverpool' => ['label' => 'Liverpool FC', 'custom' => 'foo'], 'tottenham' => ['label' => 'Tottenham Hotspur', 'custom' => 'bar'], ]),
Then referencing these in the custom Vue template:
<template> <span class="multiselect__tag"> <span>{{ option.label.trim() }}</span> <span>{{ option.custom }}</span> <i class="multiselect__tag-icon" @click="remove(option)"></i> </span> </template> ...
EDIT: This looks be possible with a very small change:
outl1ne/nova-multiselect-field/src/Multiselect.php
Change line 44 from
return ['label' => $key, 'values' => $value->map->only(['label', 'value'])->toArray()];
to:
return ['label' => $key, 'values' => $value->map->only(['label', 'value', 'custom'])->toArray()];
Then in the NovaResource
NovaResource
Multiselect::make('Football teams') ->options([ 'liverpool' => ['label' => 'Liverpool FC', 'custom'=> ['description' => 'foobarbaz']], 'tottenham' => ['label' => 'Tottenham Hotspur', 'custom'=>['description' => 'abc123']], ]),
and finally in FormFieldTag.vue
FormFieldTag.vue
{{ option.custom.description }}
Hopefully its possible 🙈
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
Thank you for adding the ability to overwrite the form tag field!
Would it be possible to pass additional option data? Specifically to use within the custom vue template? This would be really powerful. For example:
Then referencing these in the custom Vue template:
EDIT: This looks be possible with a very small change:
outl1ne/nova-multiselect-field/src/Multiselect.php
Change line 44 from
to:
Then in the
NovaResource
and finally in
FormFieldTag.vue
Hopefully its possible 🙈
The text was updated successfully, but these errors were encountered: