<template>
    <div>
        <van-nav-bar
                title="toast"
                left-arrow
                @click-left="back"
        />
        <div class="page">
            <ul>
                <li class="section loading">
                    <y-loading></y-loading>
                </li>
                <li class="section loading">
                    <y-loading topic="common" size="mini"></y-loading>
                </li>
                <li class="section loading">
                    <y-loading topic="car"></y-loading>
                </li>
                <li class="section loading">
                    <y-loading topic="pet"></y-loading>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
    import {NavBar} from 'vant';
    import yButton from '../components/yButton'
    import yLoading from "../components/yLoading";

    export default {
        components: {
            [NavBar.name]: NavBar,
            yButton,
            yLoading
        },
        data:()=>{
            return {
                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 scoped>
    .page {
        padding: 10px;
    }
    .loading{
        position: relative;
        height: 100px;
    }
</style>
