const format = { // 格式化True False formatTrueFalse(bool) { switch (bool) { case true: return {msg: '是', type: 'success', color: ''}; default: return {msg: `否`, type: 'danger', color: ''}; } }, formatTrueFalseNum(num) { switch (num) { case '1': return {msg: '是', type: 'success', color: ''}; case 1: return {msg: '是', type: 'success', color: ''}; default: return {msg: `否`, type: 'danger', color: ''}; } } } export default format