notify.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. export function success(vue, message, caption) {
  2. caption = (caption ? `<div style="font-size: 130%; color: black"><b>${caption}</b></div><br>` : '');
  3. vue.$q.notify({
  4. position: 'top-right',
  5. color: 'positive',
  6. textColor: 'white',
  7. icon: 'o_check_circle',
  8. actions: [{icon: 'o_close', color: 'black'}],
  9. html: true,
  10. message:
  11. `<div style="max-width: 350px;">
  12. ${caption}
  13. <div style="color: black; overflow-wrap: break-word; word-wrap: break-word;">${message}</div>
  14. </div>`
  15. });
  16. }
  17. export function error(vue, message, caption) {
  18. caption = (caption ? `<div style="font-size: 130%; color: yellow"><b>${caption}</b></div><br>` : '');
  19. vue.$q.notify({
  20. position: 'top-right',
  21. color: 'negative',
  22. textColor: 'white',
  23. icon: 'o_error_outline',
  24. actions: [{icon: 'o_close', color: 'black'}],
  25. html: true,
  26. message:
  27. `<div style="max-width: 350px;">
  28. ${caption}
  29. <div style="color: yellow; overflow-wrap: break-word; word-wrap: break-word;">${message}</div>
  30. </div>`
  31. });
  32. }