Skip to content

Commit 4e4290c

Browse files
author
sosout
committed
快速入门菜单
1 parent 0b1cf65 commit 4e4290c

File tree

2 files changed

+57
-12
lines changed

2 files changed

+57
-12
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ yarn install
6262
yarn run dev
6363

6464
# 生产版本,对代码进行混淆压缩,提取公共代码,分离css文件
65-
npm run build
65+
yarn run build
6666

6767
# 生产版本并查看包分析器报告
68-
npm run build --report
68+
yarn run build --report
6969

7070
# 单元测试
71-
npm run unit
71+
yarn run unit
7272

7373
# e2e测试
74-
npm run e2e
74+
yarn run e2e
7575

7676
# 所有测试
77-
npm test
77+
yarn test
7878
```
7979

8080
### 访问

src/page/quick/quick.vue

+52-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
height: 48px;
77
line-height: 48px;
88
}
9+
.el-step__description {
10+
margin-top: 15px;
11+
p {
12+
line-height: 1.5;
13+
}
14+
}
915
}
1016
}
1117
</style>
@@ -24,6 +30,9 @@
2430
color: #999;
2531
line-height: 1.5;
2632
}
33+
.card-btn {
34+
margin-top: 15px;
35+
}
2736
}
2837
}
2938
</style>
@@ -41,11 +50,31 @@
4150
<div slot="header">
4251
<span>项目上手</span>
4352
</div>
44-
<el-steps :space="200" :active="1">
45-
<el-step title="下载" description="这是一段很长很长很长的描述性文字"></el-step>
46-
<el-step title="安装" description="这是一段很长很长很长的描述性文字"></el-step>
47-
<el-step title="运行" description="这是一段很长很长很长的描述性文字"></el-step>
53+
<el-steps space="33.33%" :active="active" direction="vertical">
54+
<el-step title="下载">
55+
<div slot="description">
56+
<p>$ git clone</p>
57+
<p>$ git clone https://github.com/sosout/vue2-element.git</p>
58+
<p>$ cd vue2-element</p>
59+
</div>
60+
</el-step>
61+
<el-step title="安装">
62+
<div slot="description">
63+
<p>// 安装前请先确保已安装node和npm</p>
64+
<p>// 安装成功后,再安装依赖,如果之前有用npm安装过,请先删掉node_modules</p>
65+
<p>$ yarn install</p>
66+
</div>
67+
</el-step>
68+
<el-step title="运行">
69+
<div slot="description">
70+
<p>$ yarn run dev(开发版本,用于开发使用,热加载)</p>
71+
<p>$ yarn run build(生产版本,对代码进行混淆压缩,提取公共代码,分离css文件)</p>
72+
</div>
73+
</el-step>
4874
</el-steps>
75+
<el-button class="card-btn" v-show="active == 3" type="primary" @click="finish" size="small">完成</el-button>
76+
<el-button class="card-btn" v-show="active < 3" type="primary" @click="next" size="small">下一步</el-button>
77+
<el-button class="card-btn" v-show="active > 1" @click="prev" size="small">上一步</el-button>
4978
</el-card>
5079
<el-card class="quick-card">
5180
<div slot="header">
@@ -63,16 +92,32 @@
6392
</template>
6493

6594
<script>
66-
import { Card, Steps, Step } from 'element-ui';
95+
import { Card, Steps, Step, Button } from 'element-ui';
6796
export default {
6897
components: {
6998
ElCard: Card,
7099
ElSteps: Steps,
71-
ElStep: Step
100+
ElStep: Step,
101+
ElButton: Button
72102
},
73103
data () {
74104
return {
75-
105+
active: 1
106+
}
107+
},
108+
methods: {
109+
prev() { // 上一步
110+
const that = this;
111+
if (that.active-- < 2) that.active = 1;
112+
},
113+
next() { // 下一步
114+
const that = this;
115+
if (that.active++ > 2) that.active = 3;
116+
},
117+
finish() { // 完成
118+
const that = this;
119+
that.active = 1;
120+
that.$message.success('恭喜您,大牛!');
76121
}
77122
}
78123
}

0 commit comments

Comments
 (0)