warn.js 358 B

123456789101112131415
  1. const prefix = '[vue-router-tab]'
  2. // 错误
  3. export function assert (condition, message) {
  4. if (!condition) {
  5. throw new Error(`${prefix} ${message}`)
  6. }
  7. }
  8. // 警告
  9. export function warn (condition, message) {
  10. if (process.env.NODE_ENV !== 'production' && !condition) {
  11. typeof console !== 'undefined' && console.warn(`${prefix} ${message}`)
  12. }
  13. }