From c04b9a0267441dd0ddaae1f0bb620de5d9d8fba8 Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Mon, 12 Oct 2020 15:39:11 +0800 Subject: [PATCH] fix: config-provider renderEmpty --- components/_util/props-util.js | 5 ----- components/config-provider/index.tsx | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/components/_util/props-util.js b/components/_util/props-util.js index 9120d20d2..df28ca8c2 100644 --- a/components/_util/props-util.js +++ b/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, diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 0ad37e5e0..0d7d191a0 100644 --- a/components/config-provider/index.tsx +++ b/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); };