diff --git a/components/_util/warning.js b/components/_util/warning.js index cfacc52fd..59681e40a 100644 --- a/components/_util/warning.js +++ b/components/_util/warning.js @@ -2,6 +2,6 @@ import warning, { resetWarned } from '../vc-util/warning'; export { resetWarned }; -export default (valid, component, message) => { +export default (valid, component, message = '') => { warning(valid, `[antdv: ${component}] ${message}`); }; diff --git a/components/cascader/__tests__/index.test.js b/components/cascader/__tests__/index.test.js index c9c68abf4..430bec232 100644 --- a/components/cascader/__tests__/index.test.js +++ b/components/cascader/__tests__/index.test.js @@ -298,7 +298,7 @@ describe('Cascader', () => { expect($$('.ant-cascader-menu-item').length).toBe(2); }, 0); expect(errorSpy).toBeCalledWith( - "Warning: 'limit' of showSearch in Cascader should be positive number or false.", + "Warning: [antdv: Cascader] 'limit' of showSearch in Cascader should be positive number or false.", ); }); }); diff --git a/components/cascader/index.jsx b/components/cascader/index.jsx index 76750b003..e2862d380 100644 --- a/components/cascader/index.jsx +++ b/components/cascader/index.jsx @@ -328,6 +328,7 @@ const Cascader = { } else { warning( typeof limit !== 'number', + 'Cascader', "'limit' of showSearch in Cascader should be positive number or false.", ); filtered = flattenOptions.filter(path => filter(inputValue, path, names)); diff --git a/components/descriptions/__tests__/index.test.js b/components/descriptions/__tests__/index.test.js index 330650908..8c728d3ef 100644 --- a/components/descriptions/__tests__/index.test.js +++ b/components/descriptions/__tests__/index.test.js @@ -92,7 +92,7 @@ describe('Descriptions', () => { }, }); expect(errorSpy).toHaveBeenCalledWith( - 'Warning: [ant-design-vue: Descriptions] Sum of column `span` in a line exceeds `column` of Descriptions.', + 'Warning: [antdv: Descriptions] Sum of column `span` in a line exceeds `column` of Descriptions.', ); }); diff --git a/components/descriptions/index.jsx b/components/descriptions/index.jsx index 97791cd6e..f60a0c8a1 100644 --- a/components/descriptions/index.jsx +++ b/components/descriptions/index.jsx @@ -87,7 +87,8 @@ const generateChildrenRows = (children, column) => { warning( leftSpans === 0 && lastSpanSame, - '[ant-design-vue: Descriptions] Sum of column `span` in a line exceeds `column` of Descriptions.', + 'Descriptions', + 'Sum of column `span` in a line exceeds `column` of Descriptions.', ); } }); diff --git a/components/vc-tabs/src/ScrollableTabBarNode.jsx b/components/vc-tabs/src/ScrollableTabBarNode.jsx index d1337f5f3..6282e9664 100644 --- a/components/vc-tabs/src/ScrollableTabBarNode.jsx +++ b/components/vc-tabs/src/ScrollableTabBarNode.jsx @@ -60,7 +60,7 @@ export default { beforeDestroy() { if (this.resizeObserver) { - this.resizeObserver.remove(); + this.resizeObserver.disconnect(); } if (this.debouncedResize && this.debouncedResize.cancel) { this.debouncedResize.cancel();