当前位置: 首页 > news >正文

诸城做网站百度seo搜索排名

诸城做网站,百度seo搜索排名,企业做一个网站的费用,WordPress两种列表页console.log封装 在控制台中打印带有颜色和格式的日志信息。 /*** 检查给定的对象是否为数组*/ const isArray function (obj: any): boolean {return Object.prototype.toString.call(obj) [object Array] }/*** Logger 构造函数*/ Logger () > {}/*** 根据日志类型返回…

console.log封装

在控制台中打印带有颜色和格式的日志信息。

/*** 检查给定的对象是否为数组*/
const isArray = function (obj: any): boolean {return Object.prototype.toString.call(obj) === '[object Array]'
}/*** Logger 构造函数*/
Logger = () => {}/*** 根据日志类型返回对应的颜色*/
Logger.typeColor = function (type: string) {let color = ''switch (type) {case 'primary':color = '#2d8cf0'breakcase 'success':color = '#19be6b'breakcase 'info':color = '#909399'breakcase 'warn':color = '#ff9900'breakcase 'error':color = '#f03f14'breakdefault:color = '#35495E'break}return color
}/*** 打印日志信息,可选择是否带有背景色*/
Logger.print = function (type = 'default', text: any, back = false) {if (typeof text === 'object') {// 如果是對象則調用打印對象方式isArray(text) ? console.table(text) : console.dir(text)return}if (back) {// 如果是打印帶背景圖的console.log(`%c ${text} `,`background:${Logger.typeColor(type)}; padding: 2px; border-radius: 4px; color: #fff;`)} else {console.log(`%c ${text} `,`border: 1px solid ${Logger.typeColor(type)};padding: 2px; border-radius: 4px;color: ${Logger.typeColor(type)};`)}
}/*** 打印带有背景色的日志信息*/
Logger.printBack = function (type = 'primary', text) {this.print(type, text, true)
}/*** 打印格式化的日志信息,可选择是否带有背景色*/
Logger.pretty = function (type = 'primary', title, text) {if (typeof text === 'object') {console.group('Console Group', title)console.log(`%c ${title}`,`background:${Logger.typeColor(type)};border:1px solid ${Logger.typeColor(type)};padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`)isArray(text) ? console.table(text) : console.dir(text)console.groupEnd()return}console.log(`%c ${title} %c ${text} %c`,`background:${Logger.typeColor(type)};border:1px solid ${Logger.typeColor(type)};padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`,`border:1px solid ${Logger.typeColor(type)};padding: 1px; border-radius: 0 4px 4px 0; color: ${Logger.typeColor(type)};`,'background:transparent')
}/*** 使用 primary 类型打印格式化的日志信息*/
Logger.prettyPrimary = function (title, ...text) {text.forEach((t) => this.pretty('primary', title, t))
}/*** 使用 success 类型打印格式化的日志信息*/
Logger.prettySuccess = function (title, ...text) {text.forEach((t) => this.pretty('success', title, t))
}/*** 使用 warn 类型打印格式化的日志信息*/
Logger.prettyWarn = function (title, ...text) {text.forEach((t) => this.pretty('warn', title, t))
}/*** 使用 error 类型打印格式化的日志信息*/
Logger.prettyError = function (title, ...text) {text.forEach((t) => this.pretty('error', title, t))
}/*** 使用 info 类型打印格式化的日志信息*/
Logger.prettyInfo = function (title, ...text) {text.forEach((t) => this.pretty('info', title, t))
}export default Logger
http://www.tj-hxxt.cn/news/95134.html

相关文章:

  • 网站访问量怎么做seo 优化案例
  • 做淘宝客淘宝网站被黑智慧教育
  • 萧山网站制作公司百度小说风云榜排行榜官网
  • 幼儿园网站建设的好处搜索引擎优化师工资
  • wordpress 插件定制成都seo正规优化
  • 建设学院网站的意义如何推广宣传一个品牌
  • 在线文库网站建设百中搜
  • 重庆制作证件整站优化案例
  • 台州哪里做网站友情链接也称为
  • 合肥 网站平台建设公司公司做网络推广哪个网站好
  • 企业网站管理系统如何在百度上发广告
  • 深圳专业制作网站公司吗网络营销企业有哪些公司
  • 制作自己的网站 域名怎么弄北京做网站推广
  • 自己做卖假货网站web制作网站的模板
  • 一个微信可以做两个网站支付宝网站怎么建设
  • 可信网站证书南京seo按天计费
  • 施工企业负责人带班检查计划宁波seo排名费用
  • 学网站制作百度seo新规则
  • discuz wordpress百度seo咋做
  • 做企业展示型网站品牌宣传策划公司
  • wordpress迁移空间后无法显示图片优化
  • 网站排名优化的技巧百家联盟推广部电话多少
  • 怎么登陆建设u盾网站如何销售自己产品方法有哪些
  • 有什么做衣服的网站怎么快速优化网站
  • 茂名网站建设教网站怎么优化推荐
  • 站长推荐黄色深圳百度seo整站
  • 网络建站上海还能推seo吗
  • 阿里云 网站建设seo的概念是什么
  • 企业网站建设内容最近的新闻热点时事
  • 广州做家教的网站公司网站设计报价