toastr 页面提示条

使用:

1.引入css与js  链接: https://pan.baidu.com/s/1f53dBDZt65D0HnMjV9xOVQ 提取码: 259u
 <link href="~/Content/toastr/toastr.css" rel="stylesheet" />
 <script src="~/Content/toastr/toastr.min.js"></script>

2.js初始化
  <script type="text/javascript">
          toastr.options.positionClass = 'toast-bottom-right';//toast-bottom-right表示下右、toast-bottom-center表示下中、toast-top-center表示上中等
  </script>

3.使用前组件注册
//初始化编辑按钮
$("#btn_edit").click(function () {
     var arrselections = $("#tb_departments").bootstrapTable('getSelections');
     if (arrselections.length > 1) {
        toastr.warning('只能选择一行进行编辑');

        return;
     }
     if (arrselections.length <= 0) {
        toastr.warning('请选择有效数据');

       return;
    }
            
    $('#myModal').modal();
});

4.使用:
  toastr.success('提交数据成功');
  toastr.error('Error');
  toastr.warning('只能选择一行进行编辑');
  toastr.info('info');


参考:https://www.cnblogs.com/cpcpc/p/7233898.html
出处:https://www.cnblogs.com/cpcpc/p/7233898.html

posted @ 2020-04-03 17:24  姜佳泉  阅读(155)  评论(0编辑  收藏  举报