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