大佬教程收集整理的这篇文章主要介绍了TS-2304错误 – 在“.ts”文件中导入“jquery”时,在TypeScript中找不到名称“Iterable”,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
npm install --save @types/jquery
import * as $from 'jquery'; class Registration_Page { txtuname: String; Registration() { $('#table').hide; this.txtuname = ( <HTMLTextAreaElement> (document.getElementById('txtusername'))).value; } } window.onload = () => { $('#table').show; var bttnLogin = document.getElementById('submit'); var obj = new Registration_Page(); bttnLogin.onclick = function () { obj.Registration(); } }
index.html的代码如下:
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="registrationpage.js"></script> </head> <body> <form id="form1"> <div> <fieldset style="font-size: medium; color: #000000;"> <legend style="BACkground-color:#CCCCFF; font-size: larger;font-weight:bold">Registration Page in TypeScript</legend> <br /> <b>UserName</b> <input id="txtusername" type="text" /><br /> <br /> <input id="submit" type="button" value="Submit" /> </fieldset> </div> <div id="table"> <table> <tr> <th>UserName</th> </tr> </table> </div> </form> </body> </html>
{ "compilerOptions": { "target": "es5","noImplicitAny": true,"lib": [ "es2015","dom" ] } }
请提出适当的解决方案.
以上是大佬教程为你收集整理的TS-2304错误 – 在“.ts”文件中导入“jquery”时,在TypeScript中找不到名称“Iterable”全部内容,希望文章能够帮你解决TS-2304错误 – 在“.ts”文件中导入“jquery”时,在TypeScript中找不到名称“Iterable”所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。