fix: config-provider renderEmpty

pull/2992/head
Amour1688 4 years ago
parent f48ccdac01
commit c04b9a0267

@ -40,10 +40,6 @@ const parseStyleText = (cssText = '', camel) => {
return res; return res;
}; };
const getComponentFromSetup = (props, slots, name, options) => {
return props[name] ? props[name] : slots[name]?.(options);
};
const hasProp = (instance, prop) => { const hasProp = (instance, prop) => {
return prop in getOptionProps(instance); return prop in getOptionProps(instance);
}; };
@ -394,7 +390,6 @@ function isValidElement(element) {
} }
export { export {
getComponentFromSetup,
splitAttrs, splitAttrs,
hasProp, hasProp,
getOptionProps, getOptionProps,

@ -1,6 +1,5 @@
import { reactive, provide, VNodeTypes, PropType, defineComponent, App } from 'vue'; import { reactive, provide, VNodeTypes, PropType, defineComponent, App } from 'vue';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import { getComponentFromSetup } from '../_util/props-util';
import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty'; import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty';
import LocaleProvider, { Locale, ANT_MARK } from '../locale-provider'; import LocaleProvider, { Locale, ANT_MARK } from '../locale-provider';
@ -117,7 +116,8 @@ const ConfigProvider = defineComponent({
}; };
const renderEmptyComponent = (name?: string) => { const renderEmptyComponent = (name?: string) => {
const renderEmpty = (getComponentFromSetup(props, slots, 'renderEmpty') || const renderEmpty = (props.renderEmpty ||
slots.renderEmpty ||
defaultRenderEmpty) as RenderEmptyHandler; defaultRenderEmpty) as RenderEmptyHandler;
return renderEmpty(name); return renderEmpty(name);
}; };

Loading…
Cancel
Save