【vue】----选项卡---(简单版本)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #content{
            width: 200px;
            height: 200px;
            background: #ccc;
            overflow: hidden;
        }
        #content>div{
            width: 200px;
            height: 200px;
        }
        .active{
            background: red
        }
    </style>
</head>
<body>
    <div id="app">
          <!-- 绑定属性,作用可以动态调整样式 -->
        <button 
             v-for="(item,index) in btns" 
            :class="index == activeIndex?'active':''"
          
            @click="handleToggle(index)"
            >{{item}}</button>
        <div id="content">
                <!-- v-show="activeIndex == index"  值为true的时候显示,false的时候隐藏    -->
            <div v-for="(item,index) in contents" v-show="activeIndex == index">{{item.text}}</div>
        </div>
    </div>
</body>
</html>
<script src="vue.js"></script>
<script>
 var vm = new Vue({
     el:"#app",
     data:{
         activeIndex:0,//这个当做为一个桥梁作用,中间环节
         btns:['按钮一','按钮二','按钮三'],
         contents:[
             {
                 text:"页面一"
             },
             {
                 text:"页面二"
             },
             {
                 text:"页面三"
             }
         ]
     },
     methods: {
        handleToggle(index){
            this.activeIndex = index;
        }
     },
 })
</script>

    1、路在何方?
    路在脚下
2、何去何从?
    每个人都在探索,未来的方向在何处。如果说某些方向是世人已经公认的,那么就先按照公认的去走吧(ps:站在巨人的肩膀上看世界会清晰)。
 如果说方向,当今世人还不清晰准确。那么就大胆往前走吧,对与错并不重要。心中的方向更加重要。
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号