簡體   English   中英

如何設置 Laravel Nova Action Response Messages 的持續時間

[英]How can you set the duration of Laravel Nova Action Response Messages

根據文檔,我們有可能在運行操作時返回 toast 消息。 這些成功消息可以使用這種代碼顯示:

return Action::message('It worked!');
return Action::danger('Something went wrong!');

問題是這些消息在屏幕上只顯示幾秒鍾。

我目前正在執行一項需要 5-8 分鍾才能執行的操作,因此如果用戶單擊離開,則無法在屏幕上保留該吐司消息,以便在您打開選項卡以恢復工作時它就在那里? 也許用“好的?” 吐司上的按鈕?

使用 laravel nova 4 通知功能發送通知。

use Laravel\Nova\Notifications\NovaNotification;

$request->user()->notify(
    NovaNotification::make()
        ->message('Your report is ready to download.')
        ->action('Download', 'https://example.com/report.pdf')
        ->icon('download')
        ->type('info')
);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM