diff --git a/components/empty/index.jsx b/components/empty/index.jsx index 78dfd3f7f..35ff30b97 100644 --- a/components/empty/index.jsx +++ b/components/empty/index.jsx @@ -26,10 +26,14 @@ const Empty = { props: { ...EmptyProps(), }, + inject: { + configProvider: { default: () => ConfigConsumerProps }, + }, methods: { renderEmpty(contentLocale) { const { prefixCls: customizePrefixCls, imageStyle } = this.$props; - const prefixCls = ConfigConsumerProps.getPrefixCls('empty', customizePrefixCls); + const { getPrefixCls } = this.configProvider; + const prefixCls = getPrefixCls('empty', customizePrefixCls); const image = getComponentFromProp(this, 'image') || ; const description = getComponentFromProp(this, 'description');