const format = { // 格式化消息等级 formatMsgLv(msglv) { switch (msglv) { case 0: return {msg: '信息', type: 'info', color: ''}; case 1: return {msg: '提示', type: 'primary', color: ''}; case 2: return {msg: '成功', type: 'success', color: ''}; case 3: return {msg: '警告', type: 'warning', color: ''}; case 4: return {msg: '错误', type: 'danger', color: ''}; case 5: return {msg: '异常', type: 'danger', color: ''}; default: return {msg: `未知类型:${msglv}`, type: 'danger', color: ''}; } } } export default format