lin-xin / vue-toast

A mobile toast plugin for vue2.

Home Page:https://lin-xin.gitee.io/example/#/vue2-toast/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

能否提供.d.ts文件

shiyun opened this issue · comments

RT

没有哦

declare module 'vue/types/vue' {
    interface Toast {
        (text: string): void

        top: (text: string) => void
        center: (text: string) => void
        bottom: (text: string) => void
    }

    interface Vue {
        $toast: Toast
    }
}

loading类似


declare interface ToastOpt {
    type: "bottom" | "top" | "center"
    duration: number
    wordWrap: boolean
    width: string | "auto"
}

declare interface ToastInterface {
    (text: string, opt?: ToastOpt): void

    top: (text: string, opt?: ToastOpt) => void
    center: (text: string, opt?: ToastOpt) => void
    bottom: (text: string, opt?: ToastOpt) => void
}

declare module 'vue/types/vue' {
    interface Vue {
        $toast: ToastInterface
    }
}