vuetifyjs/vuetify

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

オープン

#20,409 opened on 2024/09/01

 (2 件のコメント) (5 件のリアクション) (0 人の担当者)TypeScript (7,139 件のフォーク)batch import
T: enhancementT: featuregood first issue

Repository metrics

Stars
 (40,995 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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."/>

コントリビューターガイド