1.0.4 • Published 9 months ago
@carodriguezg/primevue-mandatory v1.0.4
Project description
Vue directive for avoiding PrimeVue Listbox component to set a null value when an option is already selected.
WARNING: This directive has only been test on Listbox PrimeVue component, but it should work on components which use the updateModel method to update their model.
Nuxt 3 Usage
- Create a plugin in nuxt plugins folder.
- Add the following code to install the directive:
import PrimeVueMandatory from '@carodriguezg/primevue-mandatory'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(PrimeVueMandatory)
})- Add
v-mandatoryon the component:
<Listbox v-mandatory :options="your_items" />- Enjoy!