优化:AStepItem组件增加link

master
chenghx 6 years ago
parent 79b527b77f
commit a1e314e1ff
  1. 31
      src/components/tool/AStepItem.vue

@ -1,9 +1,11 @@
<template> <template>
<div> <div
<router-link to="/" style="text-decoration:none;out-line: none; color: #000"> :class="['step-item', link ? 'linkable' : null]"
@click="go"
>
<span :style="titleStyle">{{title}}</span> <span :style="titleStyle">{{title}}</span>
<a-icon :style="iconStyle" :type="icon" /> <a-icon :style="iconStyle" :type="icon" />
</router-link> <slot></slot>
</div> </div>
</template> </template>
@ -25,10 +27,27 @@ export default {
name: 'AStepItem', name: 'AStepItem',
Group: Group, Group: Group,
components: {AIcon}, components: {AIcon},
props: ['title', 'icon', 'link', 'titleStyle', 'iconStyle'] props: ['title', 'icon', 'link', 'titleStyle', 'iconStyle'],
methods: {
go () {
const link = this.link
if (link) {
this.$router.push(link)
}
}
}
} }
</script> </script>
<style scoped> <style lang="less" scoped>
.step-item{
cursor: pointer;
}
:global{
.ant-steps-item-process{
.linkable{
color: #40a9ff;
}
}
}
</style> </style>

Loading…
Cancel
Save