页首Html代码

Vue Steps 步骤条 click

Steps 步骤条 click

  

<template>
    <p>当前正在进行第 {{ current + 1 }} 步</p>
    <Steps :current="current">
        <Step title="步骤1" @click.native="test(0)">1</Step>
        <Step title="步骤2" @click.native="test(1)">2</Step>
        <Step title="步骤3" @click.native="test(2)">3</Step>
        <Step title="步骤4" @click.native="test(3)">4</Step>
    </Steps>
    <Button type="primary" @click="next">Next step</Button>
</template>
<script>
    export default {
        data () {
            return {
                current: 0
            }
        },
        methods: {
            next () {
                if (this.current == 3) {
                    this.current = 0;
                } else {
                    this.current += 1;
                }
            },
            test(obj){
               this.current = obj;
            }
        }
    }
</script>

 

posted @ 2020-07-24 16:15  sys_东  阅读(4237)  评论(0编辑  收藏  举报
页脚Html代码