<template>
    <div>
        <van-nav-bar
                title="topbar"
                left-arrow
                @click-left="back"
        />
        <div class="page">
            <ul>
                <li class="section">
                    <y-topbar title="有标题的"></y-topbar>
                </li>
                <li class="section">
                    <y-topbar is-logo></y-topbar>
                </li>
                <li class="section">
                    <y-topbar title="没有后退" :is-back="false"></y-topbar>
                </li>
                <li class="section">
                    <y-topbar title="带选项的" is-option></y-topbar>
                </li>
                <li class="section">
                    <y-topbar title="带选项的">
                        <div slot="left">left</div>
                        <div slot="right">right</div>
                    </y-topbar>
                </li>
                <li class="section">
                    <y-topbar>
                        <div slot="title">
                            <i class="topbar_test"></i>
                            slot title
                        </div>
                    </y-topbar>
                </li>
            </ul>
        </div>
    </div>
</template>

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

    export default {
        components: {
            [NavBar.name]: NavBar,
            yTopbar,
        },
        data:()=>{
            return {
                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>
