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 {

+ +