feat: default settings #141

This commit is contained in:
surunzi
2020-06-27 21:06:57 +08:00
parent 74d1ade3e8
commit 49db1041b0
5 changed files with 48 additions and 19 deletions

View File

@@ -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'
}
});
```