ant-design-vue/components/_util/warning.js
tangjinzhou b9fe970682 fix
2017-12-26 19:04:28 +08:00

15 lines
315 B
JavaScript

import warning from 'warning'
const warned = {}
export default (valid, message, throwError) => {
if (process.env.NODE_ENV !== 'production') {
if (!valid && !warned[message]) {
warning(false, message)
warned[message] = true
if (throwError) {
throw Error(message)
}
}
}
}