import { Message } from 'element-ui';

/**
 * 【成功】提示框
 */
export function successMessage(message = '成功！') {
  Message({
    message: message,
    type: 'success',
    duration: 2000,
    offset: 327
  });
}

/**
 * 【异常】提示框
 */
export function errorMessage(message = '异常！') {
  Message({
    message: message,
    type: 'error',
    duration: 2000,
    offset: 327
  });
}

/**
 * 【警告】提示框
 */
export function warningMessage(message = '警告！') {
  Message({
    message: message,
    type: 'warning',
    duration: 2000,
    offset: 327
  });
}

/**
 * 【消息】提示框
 */
export function infoMessage(message = '提示！') {
  Message({
    message: message,
    type: 'info',
    duration: 2000,
    offset: 327
  });
}

export default {
  successMessage,
  errorMessage,
  warningMessage,
  infoMessage
};
