ant-design-vue/components/_util/warning.js

10 lines
188 B
JavaScript
Raw Normal View History

2019-01-12 03:33:27 +00:00
import warning from 'warning';
2017-12-07 10:33:33 +00:00
2019-01-12 03:33:27 +00:00
const warned = {};
2019-02-01 09:23:00 +00:00
export default (valid, message) => {
2018-01-16 11:15:07 +00:00
if (!valid && !warned[message]) {
2019-01-12 03:33:27 +00:00
warning(false, message);
warned[message] = true;
2017-12-07 10:33:33 +00:00
}
2019-01-12 03:33:27 +00:00
};