function style(color, size = 12){
return `display:inline-block;background-color:${color};color:#fff;padding:2px 4px;font-size:${size}px;`
}
const dataVersion = '3.0.0'
const codeVersion = '3.0.28657969'
const branchVersion = 'release-20240617-f98487dc'
//注意此处%c后面有俩空格
console.log(
"%c ",
"font-size:40px;background:#fff;background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCI+PGRlZnM+PHBhdGggZD0iTTE0LjQuOTgzbDExLjQzIDEwLjA3LS4yNDUuMDA1aC03LjAyOUwxNi4yNDEgMjMuOTZoLTUuOTUzTDEyLjYgMTEuMDU4SDcuOTMyTDMuNzI2IDYuNTY5bDkuNjgtLjAxNi45OTQtNS41N3oiIGlkPSJhIi8+PC9kZWZzPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMykiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTIyLjM1NyAwSDQuNjExYS41MDMuNTAzIDAgMCAwLS40OTcuNDExTC4wMDggMjMuMzc3YS41LjUgMCAwIDAgLjQ5Ny41ODRoOS43ODNsLjc3NS0uMjM3aDQuNTQzbC42MzUuMjM3aDcuNTM2YS41MDMuNTAzIDAgMCAwIC40OTctLjQxMWwzLjM3OC0xOC44OUwyMi4zNTcgMHoiIGZpbGw9IiMyQTY1RjUiLz48cGF0aCBkPSJNMjIuMzU3IDBsNS4yOTUgNC42NmgtNS41MjZhLjUuNSAwIDAgMS0uNDk3LS41ODRMMjIuMzU3IDB6IiBmaWxsPSIjMDBEQ0ZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48dXNlIGZpbGw9IiNGRkYiIHhsaW5rOmhyZWY9IiNhIi8+PC9nPjwvc3ZnPg==);background-size:contain;background-repeat:no-repeat;"
);
console.log("%c腾讯文档丨表格", style("#2a65f5", 14));
console.log(`%c数据版本%c${dataVersion}`, style("#e07800"), style("rgba(69, 77, 90, 0.6)"));
console.log(`%c代码版本%c${codeVersion}`, style("#e07800"), style("rgba(69, 77, 90, 0.6)"));
console.log(`%c分支版本%c${branchVersion}`, style("#e07800"), style("rgba(69, 77, 90, 0.6)"));
console.log("%c温馨提示:请勿在此控制台输入来源不明的代码,以免您的文档数据或帐号信息遭到泄漏", style("#e02424", 14));
console.groupCollapsed("查看日志");
console.log ('输出日志信息');
console.error('输出错误信息');
输出样式