乐趣区

vuie

let data ={
        tabs:[
    {
        title:"新闻",
        sublist:[
            {subtitle:"新闻 111"},
            {subtitle:"新闻 111"},{subtitle:"新闻 111"}

        ]
    },{
        title:"娱乐",
        sublist:[
            {subtitle:"娱乐 111"},
            {subtitle:"娱乐 111"},{subtitle:"娱乐 111"}

        ]
    },{
        title:"体育",
        sublist:[
            {subtitle:"体育 111"},
            {subtitle:"体育 111"},{subtitle:"体育 111"}

        ]
    }
    ]
    ,currentIndex:-1    
    }

            new Vue({
                el:"#app",
                data:data,
                methods:{changeTabs(i){console.log(this.currentIndex)
                        this.currentIndex = this.currentIndex === i ? -1 : i;
                    },
                    addStyle(i){return {display:this.currentIndex  === i ? 'block' :'none'}
                    }
                }
            })

退出移动版