# toast

用户操作反馈的提示

# 效果

因为本文档系统的html的font-size值是16px,而h5项目50px,所以toast会显得很小

点我查看效果

# 实际效果图

实际效果图

# 位置

文件目录:public/js/toast/toast.js

请注意

该目录下的只适合非vue页面适用,如果需要vue页面引入,请引入_pure/e_global/modules/add_userInfo/toast.js

# 使用示例

import toast from '跟进相对路径引入'

export default {
    created() {
        this.$http.get('/demo').then((res) => {
            if (res.code === 0) {

            } else {
                toast(res.msg || '网络异常,请稍后再试')
            }
        }).catch((err) => {
            toast('网络异常,请稍后再试')
        })
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# 参数

参数 说明 类型 默认值
text 提示语句 String 这是一个toast
time 提示时间 Number 1000
callback toast消失之后会执行的回调 Function --