From 42f01c52c81282742a213120af002bf41558d3c3 Mon Sep 17 00:00:00 2001 From: zkwolf Date: Wed, 25 Mar 2020 14:52:12 +0800 Subject: [PATCH] feat: collapse use new icon (#1938) --- components/collapse/Collapse.jsx | 6 +- .../__tests__/__snapshots__/demo.test.js.snap | 84 +++++-------------- .../__snapshots__/index.test.js.snap | 4 +- 3 files changed, 23 insertions(+), 71 deletions(-) diff --git a/components/collapse/Collapse.jsx b/components/collapse/Collapse.jsx index f212da98c..b706bbec0 100644 --- a/components/collapse/Collapse.jsx +++ b/components/collapse/Collapse.jsx @@ -8,7 +8,7 @@ import { } from '../_util/props-util'; import { cloneElement } from '../_util/vnode'; import VcCollapse, { collapseProps } from '../vc-collapse'; -import Icon from '../icon'; +import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import { ConfigConsumerProps } from '../config-provider'; export default { @@ -28,9 +28,7 @@ export default { methods: { renderExpandIcon(panelProps, prefixCls) { const expandIcon = getComponentFromProp(this, 'expandIcon', panelProps); - const icon = expandIcon || ( - - ); + const icon = expandIcon || ; return isValidElement(Array.isArray(expandIcon) ? icon[0] : icon) ? cloneElement(icon, { class: `${prefixCls}-arrow`, diff --git a/components/collapse/__tests__/__snapshots__/demo.test.js.snap b/components/collapse/__tests__/__snapshots__/demo.test.js.snap index 161dfbb4d..3e403178c 100644 --- a/components/collapse/__tests__/__snapshots__/demo.test.js.snap +++ b/components/collapse/__tests__/__snapshots__/demo.test.js.snap @@ -4,21 +4,15 @@ exports[`renders ./antdv-demo/docs/collapse/demo/accordion.md correctly 1`] = `
- +
- +
- +
@@ -29,9 +23,7 @@ exports[`renders ./antdv-demo/docs/collapse/demo/basic.md correctly 1`] = `
-
This is panel header 1
+
This is panel header 1

A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.

@@ -39,15 +31,11 @@ exports[`renders ./antdv-demo/docs/collapse/demo/basic.md correctly 1`] = `
-
This is panel header 2
+
This is panel header 2
-
This is panel header 3
+
This is panel header 3
@@ -58,9 +46,7 @@ exports[`renders ./antdv-demo/docs/collapse/demo/borderless.md correctly 1`] = `
-
This is panel header 1
+
This is panel header 1

A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.

@@ -68,15 +54,11 @@ exports[`renders ./antdv-demo/docs/collapse/demo/borderless.md correctly 1`] = `
-
This is panel header 2
+
This is panel header 2
-
This is panel header 3
+
This is panel header 3
@@ -87,9 +69,7 @@ exports[`renders ./antdv-demo/docs/collapse/demo/custom.md correctly 1`] = `
-
This is panel header 1
+
This is panel header 1

A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.

@@ -97,15 +77,11 @@ exports[`renders ./antdv-demo/docs/collapse/demo/custom.md correctly 1`] = `
-
This is panel header 2
+
This is panel header 2
-
This is panel header 3
+
This is panel header 3
@@ -116,11 +92,7 @@ exports[`renders ./antdv-demo/docs/collapse/demo/extra.md correctly 1`] = `
-
This is panel header 1
+
This is panel header 1
@@ -129,20 +101,12 @@ exports[`renders ./antdv-demo/docs/collapse/demo/extra.md correctly 1`] = `
-
This is panel header 2
+
This is panel header 2
-
This is panel header 3
+
This is panel header 3
@@ -151,7 +115,7 @@ exports[`renders ./antdv-demo/docs/collapse/demo/extra.md correctly 1`] = `
left
-
+
@@ -161,21 +125,15 @@ exports[`renders ./antdv-demo/docs/collapse/demo/mix.md correctly 1`] = `
-
This is panel header 1
+
This is panel header 1
-
This is panel header 2
+
This is panel header 2
-
This is panel header 3
+
This is panel header 3
@@ -186,9 +144,7 @@ exports[`renders ./antdv-demo/docs/collapse/demo/noarrow.md correctly 1`] = `
-
This is panel header with arrow icon
+
This is panel header with arrow icon

A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.

diff --git a/components/collapse/__tests__/__snapshots__/index.test.js.snap b/components/collapse/__tests__/__snapshots__/index.test.js.snap index 34348b5cc..b9b32d43e 100644 --- a/components/collapse/__tests__/__snapshots__/index.test.js.snap +++ b/components/collapse/__tests__/__snapshots__/index.test.js.snap @@ -3,9 +3,7 @@ exports[`Collapse should support remove expandIcon 1`] = `
-
header
+
header