vuetifyjs/vuetify

[Feature Request] Add duration Prop to Automatically Dismiss v-alert

Open

#20.409 aperta il 1 set 2024

Vedi su GitHub
 (2 commenti) (5 reazioni) (0 assegnatari)TypeScript (7139 fork)batch import
T: enhancementT: featuregood first issue

Metriche repository

Star
 (40.995 star)
Metriche merge PR
 (Merge medio 59g 10h) (8 PR mergiate in 30 g)

Descrizione

Problem to solve

Currently, v-alert components remain visible until manually dismissed, requiring developers to implement a setTimeout() to hide the alert after a certain period. This can lead to repetitive code.

Proposed solution

Introduce a duration prop to the v-alert component. This prop accepts a number representing the duration (in milliseconds) for which the alert should remain visible before automatically closing usage example :

<v-alert :duration="5000" text=" This alert will automatically close after 5 seconds."/>

Guida contributor