라라벨/laravel vue crud
13. 토스트 알림기능만들기
땀모
2020. 2. 28. 05:21
1. 알림 패키지설치
1 | npm install toastr | cs |
2. resources/js/bootstrap.js 에 다음을 추가한다.
window.toastr = require('toastr');
resources/sass/app.scss 에 다음을 추가한다.
@import '~toastr/toastr.scss';
3. 토스트객체를 추가한다.
4. 응답메시지는 TaskController에서 추가했었음
5. 글을 작성해보자~
6. 위치변경하기
toastr: toastr.options = {"positionClass" : "toast-top-full-width"}
7. 확인 (토스트메시지가 중앙으로 이동했다.)
https://github.com/CodeSeven/toastr
8. createTask, updateTask, deleteTaks 에 넣어준다.
toastr.success(response.data.message);