Skip to content

Vue directive for avoiding PrimeVue Listbox component to set a null value when an option is already selected.

Notifications You must be signed in to change notification settings

CARodriguezG/primevue-mandatory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Create a plugin in nuxt plugins folder.
  2. Add the following code to install the directive:
import PrimeVueMandatory from '@carodriguezg/primevue-mandatory'

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(PrimeVueMandatory)
})
  1. Add v-mandatory on the component:
<Listbox v-mandatory :options="your_items" />
  1. Enjoy!

About

Vue directive for avoiding PrimeVue Listbox component to set a null value when an option is already selected.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published