툴팁 플러그인 토스터

  • 프롬프트 상자 플러그인이 많이 있으며 프레임워크에 따라 선택 항목이 다릅니다.

  • 이 경우 프롬프트 상자는 toastr 플러그인을 사용합니다. (Hanging은 GitHub 링크이며 열리지 않을 수 있음)

  • 토스터 문서

  • 사용 단계를 요약하면 다음과 같습니다.

사용 단계:

  1. toastr.css 및 toastr.js 파일 로드

  2. 글로벌 구성. 편의를 위해 toastr.js를 다음 설정에 대한 글로벌 설정으로 작성하는데, 보통 utils(global tools) 폴더에 있으며, 사용할 때 이 설정 파일을 불러오기만 하면 됩니다.

     toastr.options = {
       // "closeButton": false,
       // "debug": false,
       // "newestOnTop": false,
       // "progressBar": false,
       "positionClass": "toast-center-center", // 提示框位置,这里填类名
       // "preventDuplicates": false,
       // "onclick": null,
       "showDuration": "300",              // 提示框渐显所用时间
       "hideDuration": "300",              // 提示框隐藏渐隐时间
       "timeOut": "2000",                  // 提示框持续时间
       // "extendedTimeOut": "1000",
       // "showEasing": "swing",
       // "hideEasing": "linear",
       // "showMethod": "fadeIn",
       // "hideMethod": "fadeOut"
     }
  3. 호출 방법, 직접 사용

     toastr.info('提示信息');                // 普通提示
     toastr.success('提示信息');             // 成功提示
     toastr.warning('提示信息');             // 警告提示
     toastr.error('提示信息');               // 错误提示

추천

출처blog.csdn.net/m0_55960697/article/details/124269726