|
6 | 6 | height: 48px;
|
7 | 7 | line-height: 48px;
|
8 | 8 | }
|
| 9 | + .el-step__description { |
| 10 | + margin-top: 15px; |
| 11 | + p { |
| 12 | + line-height: 1.5; |
| 13 | + } |
| 14 | + } |
9 | 15 | }
|
10 | 16 | }
|
11 | 17 | </style>
|
|
24 | 30 | color: #999;
|
25 | 31 | line-height: 1.5;
|
26 | 32 | }
|
| 33 | + .card-btn { |
| 34 | + margin-top: 15px; |
| 35 | + } |
27 | 36 | }
|
28 | 37 | }
|
29 | 38 | </style>
|
|
41 | 50 | <div slot="header">
|
42 | 51 | <span>项目上手</span>
|
43 | 52 | </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> |
48 | 74 | </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> |
49 | 78 | </el-card>
|
50 | 79 | <el-card class="quick-card">
|
51 | 80 | <div slot="header">
|
|
63 | 92 | </template>
|
64 | 93 |
|
65 | 94 | <script>
|
66 |
| -import { Card, Steps, Step } from 'element-ui'; |
| 95 | +import { Card, Steps, Step, Button } from 'element-ui'; |
67 | 96 | export default {
|
68 | 97 | components: {
|
69 | 98 | ElCard: Card,
|
70 | 99 | ElSteps: Steps,
|
71 |
| - ElStep: Step |
| 100 | + ElStep: Step, |
| 101 | + ElButton: Button |
72 | 102 | },
|
73 | 103 | data () {
|
74 | 104 | 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('恭喜您,大牛!'); |
76 | 121 | }
|
77 | 122 | }
|
78 | 123 | }
|
|
0 commit comments