<template>
    <div>
        <van-nav-bar
                title="tabBar"
                left-arrow
                @click-left="back"
        />
        <div class="page">
            <ul>
                <li class="section">
                    <y-tab-bar :current.sync="current">
                        <y-tab-bar-item name="jd">京东</y-tab-bar-item>
                        <y-tab-bar-item name="tm">天猫</y-tab-bar-item>
                        <y-tab-bar-item name="tm21">天猫21</y-tab-bar-item>
                        <y-tab-bar-item name="pdd">平多多</y-tab-bar-item>
                        <y-tab-bar-item name="ms">美食</y-tab-bar-item>
                        <y-tab-bar-item name="ms33">美食33</y-tab-bar-item>
                        <y-tab-bar-item name="jkgl">进口狗粮</y-tab-bar-item>
                        <y-tab-bar-item name="other">这是一个长长的</y-tab-bar-item>
                        <y-tab-bar-item name="jd1">京东</y-tab-bar-item>
                        <y-tab-bar-item name="tm2">天猫</y-tab-bar-item>
                        <y-tab-bar-item name="tm213">天猫21</y-tab-bar-item>
                        <y-tab-bar-item name="pdd3">平多多</y-tab-bar-item>
                        <y-tab-bar-item name="ms4">美食</y-tab-bar-item>
                        <y-tab-bar-item name="ms353">美食33</y-tab-bar-item>
                        <y-tab-bar-item name="jkg6l">进口狗粮</y-tab-bar-item>
                        <y-tab-bar-item name="othe1r">这是一个长长的</y-tab-bar-item>
                    </y-tab-bar>
                </li>

            </ul>
        </div>
    </div>
</template>

<script>
    import {NavBar} from 'vant';
    import yTabBar from '../components/yTabBar'
    import yTabBarItem from '../components/yTabBarItem'

    export default {
        components: {
            [NavBar.name]: NavBar,
            yTabBarItem,
            yTabBar,
        },
        data:()=>{
            return {
                current:"tm21",
                index:0,
                tipsShow:false
            }
        },
        methods:{
            fnClick(type){
                //yToast.success("success");
                //yToast.error("error");
                yToast.loading();
                switch (type) {
                    case 1:
                        yToast.loading("SDfsadf");
                        break;
                    case 2:
                        yToast.success();
                        break;
                    case 3:
                        yToast.error();
                        break;
                }
                setTimeout(yToast.clear,100000);
            },
            back:()=>{
                window.history.go(-1);
            }
        },
    }
</script>

<style lang="scss">
    @import "../css/base.scss";
    .page {
        padding: 10px;
    }
    .topbar_test{
        &:after{
            content:"\e602";
            font-family: "yesaway_ui";
        }
    }
</style>
