解决Typescript报错:Property 'style' does not exist on type 'Element'
直接说问题吧:说一下我的最初代码:此时使用style修改节点的样式时报错了,报错信息如下:直接提示我们'style' does not exist 百度查找之后发现是我们没有给list做类型断言,所以typescript在检查类型的时候直接报错了。解决方法如下:给list添加<HTMLElement>做类型断言,完美解决参考资料:https://www...
原创
2019-11-26 10:38:47 ·
5301 阅读 ·
0 评论