typescript中引用better-scroll,代码如下import * as BScroll from 'better-scroll'...console.log(BScroll)new BScroll('.wrapper')...控制台输出{default: ƒ, __esModule: true}> default:ƒ BScroll(el, options) __esModule:true> __proto__:Object> Uncaught TypeError: BScroll is not a constructor...检查作者package.json中types声明没问题... "types": "./types/index.d.ts",...检查作者*.d.ts没问题...declare const BScroll: BScrollStatic;declare module 'better-scroll' { export = BScroll;}...求助,我这里是哪里错误了?
添加回答
举报
0/150
提交
取消