typescript
qq_40194097
这个作者很懒,什么都没留下…
展开
-
Missing return type on function
typescript 报错 Missing return type on function 编译不下去class Snake { //表示蛇得元素 head: HTMLElement; bodies: HTMLCollection; //蛇身体包括蛇头 //获取蛇得容器 element: HTMLElement; constructor() { this.element = document.getElementById("snikeAnimal"); this.原创 2021-11-05 14:48:44 · 427 阅读 · 0 评论 -
Type ‘number‘ is not assignable to type ‘string‘
document.getElementById('gohanCost').innerHTML = 0;报错:Type ‘number’ is not assignable to type ‘string’类型“number”不可分配给类型“string”解决方法document.getElementById('gohanCost').innerHTML = "" + 0;ordocument.getElementById('gohanCost').innerHTML = String(0);原创 2021-11-04 14:47:02 · 6921 阅读 · 0 评论