Add LifeCycleLogLabel

This commit is contained in:
MrKBear 2021-11-28 16:25:48 +08:00
parent 18b167266d
commit cea68f5145

View File

@ -0,0 +1,83 @@
import { LogStyle } from "./LogStyle";
import { LogLabel } from "./LogLabel";
/**
*
*/
const normalStyleGen = (r:number, g:number, b:number):LogStyle => {
return new LogStyle().setBorder("4px", `1px solid rgb(${ r }, ${ g }, ${ b })`)
.setColor(`rgb(${ r }, ${ g }, ${ b })`, `rgba(${ r }, ${ g }, ${ b }, .1)`)
.setBlank("0 5px");
}
/**
*
*/
class LifeCycleLogLabel {
/**
*
*/
static readonly OnLaunchLabel = new LogLabel(
"onLaunch", normalStyleGen(160, 32, 240)
);
/**
* --
*/
static readonly OnLoadLabel = new LogLabel(
"onLoad", normalStyleGen(255, 140, 105)
);
/**
* --
*/
static readonly OnReadyLabel = new LogLabel(
"onReady", normalStyleGen(255, 127, 36)
);
/**
* --
*/
static readonly OnShowLabel = new LogLabel(
"onShow", normalStyleGen(255, 215, 0)
)
/**
* --
*/
static readonly OnHideLabel = new LogLabel(
"onHide", normalStyleGen(173, 255, 47)
);
/**
* --
*/
static readonly OnUnloadLabel = new LogLabel(
"onUnload", normalStyleGen(127, 255, 212)
);
/**
* --
*/
static readonly OnPullDownRefreshLabel = new LogLabel(
"onPullDownRefresh", normalStyleGen(0, 191, 255)
);
/**
*
*/
static readonly OnReachBottomLabel = new LogLabel(
"onReachBottom", normalStyleGen(84, 255, 159)
);
/**
*
*/
static readonly OnShareAppMessageLabel = new LogLabel(
"onShareAppMessage", normalStyleGen(147, 112, 219)
);
}
export default LifeCycleLogLabel;
export { LifeCycleLogLabel };