log.js 425 B

12345678910111213141516
  1. import GlobalConfig from '../v-x-e-table/src/conf'
  2. export function getLog (message, params) {
  3. return `[vxe-table v${process.env.VUE_APP_VXE_TABLE_VERSION}] ${GlobalConfig.i18n(message, params)}`
  4. }
  5. function outLog (type) {
  6. return function (message, params) {
  7. const msg = getLog(message, params)
  8. console[type](msg)
  9. return msg
  10. }
  11. }
  12. export const warnLog = outLog('warn')
  13. export const errLog = outLog('error')