- 引入toastr.js
Link to toastr.css <link href="toastr.css" rel="stylesheet"/>
Link to toastr.js <script src="toastr.js"></script>
- 设置message显示位置(toast-bottom-right表示下右、toast-bottom-center表示下中、toast-top-center表示上中)
toastr.options.positionClass = 'toast-bottom-right';
- 使用
toastr.success('提交数据成功');
toastr.error('Error');
toastr.warning('只能选择一行进行编辑');
toastr.info('info');
- 参考官方文档连接