WangShuXian6 / blog

FE-BLOG
https://wangshuxian6.github.io/blog/
MIT License
46 stars 10 forks source link

Commissioning 调试 #135

Open WangShuXian6 opened 2 years ago

WangShuXian6 commented 2 years ago

Commissioning 调试

WangShuXian6 commented 2 years ago

Console

Eruda

https://github.com/liriliri/eruda https://github.com/liriliri/eruda/blob/master/doc/README_CN.md Eruda 是一个专为手机网页前端设计的调试面板,类似 DevTools 的迷你版,其主要功能包括:捕获 console 日志、检查元素状态、捕获XHR请求、显示本地存储和 Cookie 信息等等。

npm install eruda --save

类型

src/type.d.ts

declare module 'eruda'

tsconfig.json

{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src",
"src/type.d.ts"
]
}

初始化

import eruda from 'eruda'
eruda.init()