We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
实现效果:定时关闭alert, Alert 代码: ........ echo \yii2mod\alert\Alert::widget([ 'useSessionFlash' => false, 'options' => [ 'timer' => null, 'type' => $type, 'title' => $message, 'timer'=> 1500, // 'showConfirmButton'=> false ] ]); ....... 发现并没有自动关闭,查看 源码 yii2mod/yii2-sweet-alert/Alert.php文件
...... protected function registerAssets() { if ($this->hasTitle()) { $view = $this->getView(); AlertAsset::register($view); //var_dump($this->getOptions());exit; $js = "sweetAlert({$this->getOptions()}, {$this->callback});"; $view->registerJs($js, $view::POS_END); } } ....... 把 $js = "sweetAlert({$this->getOptions()}, {$this->callback});"; 改为 $js = "sweetAlert({$this->getOptions()});"; 定时效果搞定
The text was updated successfully, but these errors were encountered:
No branches or pull requests
实现效果:定时关闭alert,
Alert 代码:
........
echo \yii2mod\alert\Alert::widget([
'useSessionFlash' => false,
'options' => [
'timer' => null,
'type' => $type,
'title' => $message,
'timer'=> 1500,
// 'showConfirmButton'=> false
]
]);
.......
发现并没有自动关闭,查看 源码 yii2mod/yii2-sweet-alert/Alert.php文件
......
protected function registerAssets()
{
if ($this->hasTitle()) {
$view = $this->getView();
AlertAsset::register($view);
//var_dump($this->getOptions());exit;
$js = "sweetAlert({$this->getOptions()}, {$this->callback});";
$view->registerJs($js, $view::POS_END);
}
}
.......
把 $js = "sweetAlert({$this->getOptions()}, {$this->callback});"; 改为
$js = "sweetAlert({$this->getOptions()});";
定时效果搞定
The text was updated successfully, but these errors were encountered: