diff --git a/src/step/index.tsx b/src/step/index.tsx index 9c61a91e3..7e12d3a22 100644 --- a/src/step/index.tsx +++ b/src/step/index.tsx @@ -73,7 +73,11 @@ export default createComponent({ ); } - if (getStatus() === 'finish' && finishIcon) { + if (getStatus() === 'finish' && (finishIcon || slots['finish-icon'])) { + if (slots['finish-icon']) { + return slots['finish-icon'](); + } + return ( `; +exports[`should render finish icon slot correctly 1`] = ` +
+
+ A +
+
+ Custim Fiinsh Icon +
+
+
+
+`; + exports[`should render icon slot correctly 1`] = `
diff --git a/src/steps/test/index.spec.tsx b/src/steps/test/index.spec.tsx index e98dc1b7e..3d35f6b53 100644 --- a/src/steps/test/index.spec.tsx +++ b/src/steps/test/index.spec.tsx @@ -90,3 +90,19 @@ test('should change finish icon when using finish-icon prop', () => { expect(firstStep.find('.van-icon-foo').exists()).toBeTruthy(); expect(firstStep.html()).toMatchSnapshot(); }); + +test('should render finish icon slot correctly', () => { + const wrapper = mount({ + render() { + return ( + + `Custim Fiinsh Icon` }}>A + B + + ); + }, + }); + + const firstStep = wrapper.find('.van-step'); + expect(firstStep.html()).toMatchSnapshot(); +});