mirror of
https://github.com/liriliri/eruda.git
synced 2026-02-06 10:07:48 +08:00
docs: modern js usage example
This commit is contained in:
10
README.md
10
README.md
@@ -58,7 +58,7 @@ javascript:(function () { var script = document.createElement('script'); script.
|
||||
You can get it on npm.
|
||||
|
||||
```bash
|
||||
npm install eruda --save
|
||||
npm install eruda --save-dev
|
||||
```
|
||||
|
||||
Add this script to your page.
|
||||
@@ -86,6 +86,14 @@ The JavaScript file size is quite huge(about 100kb gzipped) and therefore not su
|
||||
})();
|
||||
```
|
||||
|
||||
If you are using modern JavaScript tooling, you can dynamically import it.
|
||||
|
||||
```javascript
|
||||
if (import.meta.env.MODE === 'development') {
|
||||
import('eruda').then(eruda => eruda.default.init());
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
When initialization, a configuration object can be passed in.
|
||||
|
||||
Reference in New Issue
Block a user