fix: config-provider renderEmpty

pull/2992/head
Amour1688 2020-10-12 15:47:32 +08:00
parent f48ccdac01
commit 9214632841
4 changed files with 4 additions and 9 deletions

@ -1 +1 @@
Subproject commit 88970d13f8e2e6f5c96a28697fe0b399eccdcb07
Subproject commit 83ab203d1ab9861132f6efd1e74015507c0e45f6

View File

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

View File

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

View File

@ -27,7 +27,7 @@ const RenderEmpty = (props: RenderEmptyProps) => {
return <Empty />;
}
};
return () => renderHtml(props.componentName);
return renderHtml(props.componentName);
};
function renderEmpty(componentName?: string) {