在做项目时我遇到了一个小问题,情况如下:
该问题是因为在配置tsconfig.json中,进行了如下配置:
```js
{ //tsconfig.json
"compilerOptions": {
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
}
}
```
最终我在dayJs的官方文档中找到了解决方法
[安装 | Day.js中文网 (fenxianglu.cn)](https://dayjs.fenxianglu.cn/category/#typescript)
```js
import * as dayjs from 'dayjs'
```
将引入改为此代码即可解决