Closed thombruce closed 4 months ago
Still todo:
We should also...
This might be best done using Nuxt's utils/
folder: https://nuxt.com/docs/guide/directory-structure/utils
Out of scope here, but we have the beginnings of a novel component idea. Call it something like FromYaml
or ComponentsFromYaml
or FromSerialized
(since this would probably work with JSON and TOML too).
template(v-for="component in body")
component(
:is="tntComponents.includes(_keys(component)[0]) ? `tnt-${_keys(component)[0]}` : _keys(component)[0]"
v-bind="{ ..._omit(_values(component)[0], ['validate', 'rules']), ...{ fullErrors } }"
)
template(v-if="typeof _values(component)[0] === 'string'") {{ _values(component)[0] }}
template(v-else-if="_keys(component).includes('body')") {{ component.body }}
Notice that on the last line, instead of rendering component.body
inside of a template, we could pass component.body
to the top template(v-for="component in body")
component and have deeply nested components rendered from YAML files.
A rare use case, since the same could more easily be achieved from a .md
file... but could prove useful for more than just the form layout. Worth creating the component anyway, even if only to simplify the TntForm.vue
component.
Inputs needing new Vee-validate + Yup logic:
Excepting Combobox, there are two remaining to do. For radios and checkboxes, see: https://vee-validate.logaretm.com/v4/examples/checkboxes-and-radio
Caveats on the checkbox and radio front:
closes #28
By submitting this pull request, you agree to follow our Code of Conduct: https://github.com/thombruce/.github/blob/main/CODE_OF_CONDUCT.md
Internal use. Do not delete.