分为两种情况:
- 没有在tsconfig.json中进行如下配置
"compilerOptions": {
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
}
在使用dayjs的页面中通过如下进行导入
important * as dayjs from 'dayjs';
- 如果进行了配置,则需要通过如下方式导入
important dayjs from 'dayjs';