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;}...求助,我這里是哪里錯誤了?
typescript中引用better-scroll
達令說
2019-03-04 21:23:09