Skip to content

Commit 6953698

Browse files
authored
fix(empty): cannot get prefixCls in configProvider #4446 (#4447)
close #4446
1 parent a4ce890 commit 6953698

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/empty/index.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ const Empty = {
2626
props: {
2727
...EmptyProps(),
2828
},
29+
inject: {
30+
configProvider: { default: () => ConfigConsumerProps },
31+
},
2932
methods: {
3033
renderEmpty(contentLocale) {
3134
const { prefixCls: customizePrefixCls, imageStyle } = this.$props;
32-
const prefixCls = ConfigConsumerProps.getPrefixCls('empty', customizePrefixCls);
35+
const { getPrefixCls } = this.configProvider;
36+
const prefixCls = getPrefixCls('empty', customizePrefixCls);
3337
const image = getComponentFromProp(this, 'image') || <DefaultEmptyImg />;
3438
const description = getComponentFromProp(this, 'description');
3539

0 commit comments

Comments
 (0)