This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag

使用import moment from 'moment'后报错

解决办法:在tsconfig.json中增加配置

"allowSyntheticDefaultImports": true允许从没有默认导出的模块引入
posted @ 2021-07-09 11:08  去有风的地方  阅读(3113)  评论(0编辑  收藏  举报