np-form Custom Footer
Customize the footer through the footer prop.
footer.en.vue
Align Right
Set align="right" to align the footer content to the end. The validation feedback is aligned to the end as well.
footer-align.en.vue
Component Configuration
FormOption Props
| Prop | Description | Type | Default |
|---|---|---|---|
| footer | Footer config; set to false to hide the whole footer | boolean / FooterProps | - |
Footer Props
| Prop | Description | Type | Default |
|---|---|---|---|
| submitBtn | Whether to show the submit button | boolean | true |
| resetBtn | Whether to show the reset button | boolean | true |
| submitErrorFeedback | Whether to show the submit (onSubmit) error message as the feedback of the footer form item | boolean | true |
| align | Footer content alignment; right aligns to the end and moves the validation feedback to the end as well | 'left' | 'right' | 'left' |
| prefixRender | Prefix render function | (data)=>VNode | - |
| suffixRender | Suffix render function | (data)=>VNode | - |
Global Defaults
formItemProps / style / align / submitErrorFeedback / submitBtn / resetBtn can be set globally through NpConfigProvider. The same config in option.footer takes priority, and option.footer: false still hides the whole footer.
<np-config-provider
:component-options="{
Form: {
footer: {
align: 'right',
submitBtn: { text: 'Save' },
},
},
}"
>
<np-form :option="option" />
</np-config-provider>
prefixRender / suffixRender are content render functions, specify them at the usage site.
Button text priority: submitBtn.text / resetBtn.text > componentOptions.Form.footer of NpConfigProvider > the locale messages. Prefer locale when you need i18n.
