全局配置。为方便,我们将下面的配置放到 assets/utils/toastr.js 中,使用时,加载这个配置文件
toastr.options = {
// "closeButton": false,
// "debug": false,
// "newestOnTop": false,
// "progressBar": false,
"positionClass": "toast-top-right", // 提示框位置,这里填类名
// "preventDuplicates": false,
// "onclick": null,
"showDuration": "300", // 提示框渐显所用时间
"hideDuration": "300", // 提示框隐藏渐隐时间
"timeOut": "2000", // 提示框持续时间
// "extendedTimeOut": "1000",
// "showEasing": "swing",
// "hideEasing": "linear",
// "showMethod": "fadeIn",
// "hideMethod": "fadeOut"
}
调用方法,直接使用
toastr.info('提示信息'); // 普通提示
toastr.success('提示信息'); // 成功提示
toastr.warning('提示信息'); // 警告提示
toastr.error('提示信息'); // 错误提示
饼形图: https://echarts.apache.org/examples/zh/editor.html?c=pie-roseType-simple
折线图1: https://echarts.apache.org/examples/zh/editor.html?c=area-simple
折线图2: https://echarts.apache.org/examples/zh/editor.html?c=line-smooth
柱形图: https://echarts.apache.org/examples/zh/editor.html?c=mix-line-bar
api地址: https://echarts.apache.org/zh/option.html