已采納回答 / 西門老舅
其實引入的JS文件不是說在TS文件中不能用,用是沒問題的。而是TS不認識這個JS中的定義,如jquery中的$,編輯器就會報錯,所以才需要對應的d.ts文件。說白了TS還不那么智能,需要這種聲明文件給出明確的定義方式。
2020-07-17
TS2339: Property 'insert' does not exist on type '{}'.
TS2339: Property 'singleton' does not exist on type '{}'.
TS2339: Property 'i' does not exist on type 'any[]'.
運行后,會有這個報錯
TS2339: Property 'singleton' does not exist on type '{}'.
TS2339: Property 'i' does not exist on type 'any[]'.
運行后,會有這個報錯
2020-07-17
10:45老師說的ts中引入css的兩種方式,一種node 的commonjs方式,一種es6 的css module方式,真是精彩,如果事先不知道老師講得這個知識點,不知道要踩多少坑
2020-07-06