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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM