📜  typescript 如何为控制台记录器着色 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:27.634000             🧑  作者: Mango

代码示例2
//has to be backtick comma to interpolate.
public colorLogger(str: any, color = "red"){
    console.log(`%c ${str}`, `color: ${color}; font-weight: bold;`);
}