mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
feat: default settings #141
This commit is contained in:
18
doc/API.md
18
doc/API.md
@@ -12,16 +12,30 @@ Initialize eruda.
|
||||
|tool |string array|Choose which default tools you want, by default all will be added |
|
||||
|autoScale=true |boolean |Auto scale eruda for different viewport settings |
|
||||
|useShadowDom=true|boolean |Use shadow dom for css encapsulation |
|
||||
|defaults |object |Default settings |
|
||||
|
||||
Available default settings:
|
||||
|
||||
|Name |Type |Desc |
|
||||
|------------|------|---------------------------------------------|
|
||||
|transparency|number|Transparency, 0 to 1 |
|
||||
|displaySize |number|Display size, 0 to 100 |
|
||||
|theme |string|Theme, defaults to Light or Dark in dark mode|
|
||||
|
||||
```javascript
|
||||
let el = document.createElement('div');
|
||||
const el = document.createElement('div');
|
||||
document.body.appendChild(el);
|
||||
|
||||
eruda.init({
|
||||
container: el,
|
||||
tool: ['console', 'elements'],
|
||||
useShadowDom: true,
|
||||
autoScale: true
|
||||
autoScale: true,
|
||||
defaults: {
|
||||
displaySize: 50,
|
||||
transparency: 0.9,
|
||||
theme: 'Monokai Pro'
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user