mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-13 10:48:35 +08:00
Dev: Expose log methods of console
This commit is contained in:
@@ -17,6 +17,7 @@ export default class Console extends Tool
|
||||
|
||||
this._appendTpl();
|
||||
this._initLog();
|
||||
this._exposeLog();
|
||||
this._initConfig(parent);
|
||||
this._bindEvent(parent);
|
||||
}
|
||||
@@ -103,6 +104,12 @@ export default class Console extends Tool
|
||||
$this[isMatch ? 'addClass' : 'rmClass']('eruda-active');
|
||||
}));
|
||||
}
|
||||
_exposeLog()
|
||||
{
|
||||
let log = this._log;
|
||||
|
||||
CONSOLE_METHOD.forEach(name => this[name] = (...args) => log[name](...args));
|
||||
}
|
||||
_bindEvent(parent)
|
||||
{
|
||||
let $input = this._$input,
|
||||
|
||||
Reference in New Issue
Block a user