An open API service indexing awesome lists of open source software.

https://github.com/carodriguezg/primevue-mandatory

Vue directive for avoiding PrimeVue Listbox component to set a null value when an option is already selected.
https://github.com/carodriguezg/primevue-mandatory

directive mandatory nuxt nuxt3 primevue vue vue3

Last synced: 4 months ago
JSON representation

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

Awesome Lists containing this project

README

          

## 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](https://nuxt.com/docs/guide/directory-structure/plugins).
2. Add the following code to install the directive:

```typescript
import PrimeVueMandatory from '@carodriguezg/primevue-mandatory'

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(PrimeVueMandatory)
})
```
3. Add `v-mandatory` on the component:
```html

```
4. Enjoy!