已采纳回答 / 西门老舅
其实引入的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