开发者中使用——控制台打印数据
热门内容榜 • 最近上榜 控制台打印输出数据是开发中很常用的功能一、系统打印方法1.基础打印console.logconsole.log('Failedtoloadthecontent.Cause:%{public}s','1',sysBarProps)2.打印复杂数据结构如果对象、数组层级较深,可使用JSON.stringify()格式化后输出,避免内容被省略:console.info('cateNameArr',JSON.stringify(this.cateNameArr,null,2));打印数据如下,数组里面对象格式二、使用打印组件1.hilog,也是默认模块入口Ability中使用的impo...