From f88ce93b02bc184405c748c5e375793f448a4f9b Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 23 Feb 2020 14:34:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20steps=20add=20type=E3=80=81=20v-model?= =?UTF-8?q?=E3=80=81subTitle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/config.js | 2 +- .../__tests__/__snapshots__/demo.test.js.snap | 598 +++++++++++++----- components/steps/__tests__/index.test.js | 6 + components/steps/demo/clickable.md | 42 ++ components/steps/demo/index.vue | 4 + components/steps/demo/nav.md | 71 +++ components/steps/demo/progress-dot.md | 10 + components/steps/demo/simple.md | 2 +- components/steps/index.en-US.md | 39 +- components/steps/index.jsx | 5 + components/steps/index.zh-CN.md | 39 +- components/vc-steps/Step.jsx | 46 +- components/vc-steps/Steps.jsx | 42 +- components/vc-steps/index.js | 2 +- types/steps/step.d.ts | 2 + types/steps/steps.d.ts | 2 +- 16 files changed, 713 insertions(+), 199 deletions(-) create mode 100644 components/steps/__tests__/index.test.js create mode 100644 components/steps/demo/clickable.md create mode 100644 components/steps/demo/nav.md diff --git a/build/config.js b/build/config.js index a75a866b4..cce4d0f4a 100644 --- a/build/config.js +++ b/build/config.js @@ -1,5 +1,5 @@ module.exports = { dev: { - componentName: 'input', // dev components + componentName: 'steps', // dev components }, }; diff --git a/components/steps/__tests__/__snapshots__/demo.test.js.snap b/components/steps/__tests__/__snapshots__/demo.test.js.snap index 2a2e89590..74785df53 100644 --- a/components/steps/__tests__/__snapshots__/demo.test.js.snap +++ b/components/steps/__tests__/__snapshots__/demo.test.js.snap @@ -1,38 +1,116 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`renders ./components/steps/demo/clickable.md correctly 1`] = ` +
+
+
+
+
+
1
+
+
Step 1
+
This is a description.
+
+
+
+
+
+
+
2
+
+
Step 2
+
This is a description.
+
+
+
+
+
+
+
3
+
+
Step 3
+
This is a description.
+
+
+
+
+ +
+
+
+
+
1
+
+
Step 1
+
This is a description.
+
+
+
+
+
+
+
2
+
+
Step 2
+
This is a description.
+
+
+
+
+
+
+
3
+
+
Step 3
+
This is a description.
+
+
+
+
+
+`; + exports[`renders ./components/steps/demo/customized-progress-dot.md correctly 1`] = `
-
-
-
-
Finished
-
You can hover on the dot.
+
+
+
+
+
Finished
+
You can hover on the dot.
+
-
-
-
-
-
In Progress
-
You can hover on the dot.
+
+
+
+
+
+
In Progress
+
You can hover on the dot.
+
-
-
-
-
Waiting
-
You can hover on the dot.
+
+
+
+
+
Waiting
+
You can hover on the dot.
+
-
-
-
-
Waiting
-
You can hover on the dot.
+
+
+
+
+
Waiting
+
You can hover on the dot.
+
@@ -42,27 +120,33 @@ exports[`renders ./components/steps/demo/customized-progress-dot.md correctly 1` exports[`renders ./components/steps/demo/error.md correctly 1`] = `
-
-
-
-
Finished
-
This is a description.
+
+
+
+
+
Finished
+
This is a description.
+
-
-
-
-
-
In Progress
-
This is a description.
+
+
+
+
+
+
In Progress
+
This is a description.
+
-
-
3
-
-
Waiting
-
This is a description.
+
+
+
3
+
+
Waiting
+
This is a description.
+
@@ -70,61 +154,246 @@ exports[`renders ./components/steps/demo/error.md correctly 1`] = ` exports[`renders ./components/steps/demo/icon.md correctly 1`] = `
-
-
-
-
-
Login
+
+
+
+
+
+
Login
+
-
-
-
-
Verification
+
+
+
+
+
Verification
+
-
-
-
-
Pay
+
+
+
+
+
Pay
+
-
-
-
-
Done
+
+
+
+
+
Done
+
+
+
+
+`; + +exports[`renders ./components/steps/demo/nav.md correctly 1`] = ` +
+
+
+
+
+
+
+
Step 1
00:00:05
+
+
This is a description.
+
+
+
+
+
+
+
2
+
+
Step 2
00:01:02
+
+
This is a description.
+
+
+
+
+
+
+
3
+
+
Step 3
waiting for longlong time
+
+
This is a description.
+
+
+
+
+
+
+
+
+
+
+
Step 1
+
+
+
+
+
+
+
2
+
+
Step 2
+
+
+
+
+
+
+
3
+
+
Step 3
+
+
+
+
+
+
+
4
+
+
Step 4
+
+
+
+
+
+
+
+
+
+
+
finish 1
+
+
+
+
+
+
+
+
+
finish 2
+
+
+
+
+
+
+
3
+
+
current process
+
+
+
+
+
+
+
4
+
+
wait
+
+
`; exports[`renders ./components/steps/demo/progress-dot.md correctly 1`] = ` -
-
-
-
-
-
Finished
-
This is a description.
+
+
+
+
+
+
+
+
Finished
+
This is a description.
+
+
+
+
+
+
+
+
+
In Progress
+
This is a description.
+
+
+
+
+
+
+
+
+
Waiting
+
This is a description.
+
+
-
-
-
-
-
In Progress
-
This is a description.
+ +
+
+
+
+
+
+
Finished
+
This is a description. This is a description.
+
+
-
-
-
-
-
-
Waiting
-
This is a description.
+
+
+
+
+
+
Finished
+
This is a description. This is a description.
+
+
+
+
+
+
+
+
+
In Progress
+
This is a description. This is a description.
+
+
+
+
+
+
+
+
+
Waiting
+
This is a description.
+
+
+
+
+
+
+
+
+
Waiting
+
This is a description.
+
+
@@ -133,29 +402,36 @@ exports[`renders ./components/steps/demo/progress-dot.md correctly 1`] = ` exports[`renders ./components/steps/demo/simple.md correctly 1`] = `
-
-
-
-
- Finished +
+
+
+
+
+ Finished +
+
This is a description.
-
This is a description.
-
-
-
2
-
-
In Progress
-
This is a description.
+
+
+
+
2
+
+
In Progress
Left 00:00:08
+
+
This is a description.
+
-
-
3
-
-
Waiting
-
This is a description.
+
+
+
3
+
+
Waiting
+
This is a description.
+
@@ -164,24 +440,30 @@ exports[`renders ./components/steps/demo/simple.md correctly 1`] = ` exports[`renders ./components/steps/demo/small-size.md correctly 1`] = `
-
-
-
-
Finished
+
+
+
+
+
Finished
+
-
-
-
2
-
-
In Progress
+
+
+
+
2
+
+
In Progress
+
-
-
3
-
-
Waiting
+
+
+
3
+
+
Waiting
+
@@ -190,25 +472,31 @@ exports[`renders ./components/steps/demo/small-size.md correctly 1`] = ` exports[`renders ./components/steps/demo/step-next.md correctly 1`] = `
-
-
-
1
-
-
First
+
+
+
+
1
+
+
First
+
-
-
2
-
-
Second
+
+
+
2
+
+
Second
+
-
-
3
-
-
Last
+
+
+
3
+
+
Last
+
@@ -223,27 +511,33 @@ exports[`renders ./components/steps/demo/step-next.md correctly 1`] = ` exports[`renders ./components/steps/demo/vertical.md correctly 1`] = `
-
-
-
-
Finished
-
This is a description.
+
+
+
+
+
Finished
+
This is a description.
+
-
-
-
2
-
-
In Progress
-
This is a description.
+
+
+
+
2
+
+
In Progress
+
This is a description.
+
-
-
3
-
-
Waiting
-
This is a description.
+
+
+
3
+
+
Waiting
+
This is a description.
+
@@ -252,27 +546,33 @@ exports[`renders ./components/steps/demo/vertical.md correctly 1`] = ` exports[`renders ./components/steps/demo/vertical-small.md correctly 1`] = `
-
-
-
-
Finished
-
This is a description.
+
+
+
+
+
Finished
+
This is a description.
+
-
-
-
2
-
-
In Progress
-
This is a description.
+
+
+
+
2
+
+
In Progress
+
This is a description.
+
-
-
3
-
-
Waiting
-
This is a description.
+
+
+
3
+
+
Waiting
+
This is a description.
+
diff --git a/components/steps/__tests__/index.test.js b/components/steps/__tests__/index.test.js new file mode 100644 index 000000000..6a6554105 --- /dev/null +++ b/components/steps/__tests__/index.test.js @@ -0,0 +1,6 @@ +import Steps from '..'; +import mountTest from '../../../tests/shared/mountTest'; + +describe('Steps', () => { + mountTest(Steps); +}); diff --git a/components/steps/demo/clickable.md b/components/steps/demo/clickable.md new file mode 100644 index 000000000..49e13c8b5 --- /dev/null +++ b/components/steps/demo/clickable.md @@ -0,0 +1,42 @@ + +#### 可点击 +设置 `@change` 后,Steps 变为可点击状态。 + + + +#### Clickable +Setting `@change` makes Steps clickable. + + +```tpl + + +``` diff --git a/components/steps/demo/index.vue b/components/steps/demo/index.vue index 9c002f71e..46b6d5c07 100644 --- a/components/steps/demo/index.vue +++ b/components/steps/demo/index.vue @@ -8,6 +8,8 @@ import SmallSize from './small-size'; import StepNext from './step-next'; import VerticalSmall from './vertical-small'; import Vertical from './vertical'; +import Clickable from './clickable'; +import Nav from './nav'; import CN from '../index.zh-CN.md'; import US from '../index.en-US.md'; @@ -58,6 +60,8 @@ export default {

+ +