message.js 515 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { Message } from 'element-ui';
  2. const info = msg => {
  3. Message({
  4. message: msg,
  5. type: 'info',
  6. duration: 5 * 1000
  7. });
  8. };
  9. const success = msg => {
  10. Message({
  11. message: msg,
  12. type: 'success',
  13. duration: 5 * 1000
  14. });
  15. };
  16. const warning = msg => {
  17. Message({
  18. message: msg,
  19. type: 'warning',
  20. duration: 5 * 1000
  21. });
  22. };
  23. const error = msg => {
  24. Message({
  25. message: msg,
  26. type: 'error',
  27. duration: 5 * 1000
  28. });
  29. };
  30. export default { success, info, warning, error };