Migration Guide for nv-fieldradio
In the latest version of the nv-fieldradio component, we've made several important changes to the properties to improve usability and consistency. Below is a guide to help you update your existing components from version 2 to version 3.
Deprecations
1. prop message -> description
The message property has been renamed to description. This new name better describes the property's functionality, which allows the radio button to be clearer and more informative.
Old Usage:
<nv-fieldradio message="Description of the radio button"></nv-fieldradio>
New Usage:
<nv-fieldradio description="Description of the radio button"></nv-fieldradio>
2. prop labelBefore -> labelPlacement
The labelBefore property has been renamed to labelPlacement. This new name better describes the property's functionality, which allows the radio button to be clearer and more informative.
Old Usage:
<nv-fieldradio labelBefore></nv-fieldradio>
New Usage:
<nv-fieldradio labelPlacement="before"></nv-fieldradio>
<nv-fieldradio labelPlacement="after"></nv-fieldradio>
Breaking Changes
1. prop labelBeforeWidth -> removed
The labelBeforeWidth property has been removed. Use css styles instead.
2. prop validation -> removed
The validation property has been removed. Use the error property together with errorDescription instead.
Old Usage:
<nv-fieldradio validation="Validation message"></nv-fieldradio>
New Usage:
<nv-fieldradio error errorDescription="Validation message"></nv-fieldradio>
3. event change -> checkedChanged
The change event has been renamed to checkedChanged.
Old Usage:
<nv-fieldradio @change="handleChange"></nv-fieldradio>
New Usage:
<nv-fieldradio @checkedChanged="handleCheckedChanged"></nv-fieldradio>