2018-08-07 18:08:31 +08:00
|
|
|
<template>
|
2018-08-08 10:05:53 +08:00
|
|
|
<div
|
|
|
|
|
:class="['step-item', link ? 'linkable' : null]"
|
|
|
|
|
@click="go"
|
|
|
|
|
>
|
|
|
|
|
<span :style="titleStyle">{{title}}</span>
|
|
|
|
|
<a-icon :style="iconStyle" :type="icon" />
|
|
|
|
|
<slot></slot>
|
2018-08-07 18:08:31 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
const Group = {
|
|
|
|
|
name: 'AStepItemGroup',
|
2020-06-28 20:24:08 +08:00
|
|
|
props: {
|
|
|
|
|
align: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: 'center',
|
|
|
|
|
validator(value) {
|
|
|
|
|
return ['left', 'center', 'right'].indexOf(value) != -1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2018-08-07 18:08:31 +08:00
|
|
|
render (h) {
|
|
|
|
|
return h(
|
|
|
|
|
'div',
|
2020-06-28 20:24:08 +08:00
|
|
|
{attrs: {style: `text-align: ${this.align}; margin-top: 8px`}},
|
2018-08-07 18:08:31 +08:00
|
|
|
[h('div', {attrs: {style: 'text-align: left; display: inline-block;'}}, [this.$slots.default])]
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'AStepItem',
|
|
|
|
|
Group: Group,
|
2018-08-08 10:05:53 +08:00
|
|
|
props: ['title', 'icon', 'link', 'titleStyle', 'iconStyle'],
|
|
|
|
|
methods: {
|
|
|
|
|
go () {
|
|
|
|
|
const link = this.link
|
|
|
|
|
if (link) {
|
|
|
|
|
this.$router.push(link)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-08-07 18:08:31 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2018-08-08 10:05:53 +08:00
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.step-item{
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
:global{
|
|
|
|
|
.ant-steps-item-process{
|
|
|
|
|
.linkable{
|
|
|
|
|
color: #40a9ff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-08-07 18:08:31 +08:00
|
|
|
</style>
|