This commit is contained in:
2021-02-08 00:46:15 +08:00
parent c730613052
commit 877aee4119
6 changed files with 170 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ class Utils {
* 初始化链接列表设置唯一ID
*/
initNavLinkID() {
// 载中提示
// 载中提示
var loading = Loading.service({
customClass: 'loading-link',
lock: true,
@@ -50,7 +50,7 @@ class Utils {
var timer = setInterval(() => {
if (currentIndex == currentIndexCpy) {
clearInterval(timer);
// 载中提示
// 载中提示
loading.close();
}
@@ -61,6 +61,23 @@ class Utils {
return fn;
}
/**
* 输出日志
*
* @param {string} type 日志类型info、warn、error
* @param {string} title 日志标题
* @param {any} datas 日志内容
*/
log(type, title, ...datas) {
if (type == 'info') {
console.info(`[${title}]`, datas);
} else if (type == 'warn') {
console.warn(`[${title}]`, datas);
} else if (type == 'error') {
console.error(`[${title}]`, datas);
}
}
}
const utils = new Utils;