Browse Source

fix: config-provider renderEmpty

pull/2992/head
Amour1688 4 years ago
parent
commit
c04b9a0267
  1. 5
      components/_util/props-util.js
  2. 4
      components/config-provider/index.tsx

5
components/_util/props-util.js

@ -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,

4
components/config-provider/index.tsx

@ -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);
};

Loading…
Cancel
Save