Notyf是一个超级简单的,响应式,原生javascript插件,用来显示通知。
演示安装安装npm包:
npm install --save notyf添加至项目:
<html> <head> ... <link rel="stylesheet" type="text/css" href="/path/to/notyf.min.css"> </head> <body> ... <script src="/path/to/notyf.min.js" type="text/javascript"></script> </body></html>使用//Create an instance of Notyfvar notyf = new Notyf();//Display an alert notificationnotyf.alert('You must fill out the form before moving forward');//Display a success notificationnotyf.confirm('Your changes have been successfully saved!');
评论