Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript HtmleElement禁用1.4到1.6发生了什么(TS2339)?_Typescript_Visual Studio 2015 - Fatal编程技术网

Typescript HtmleElement禁用1.4到1.6发生了什么(TS2339)?

Typescript HtmleElement禁用1.4到1.6发生了什么(TS2339)?,typescript,visual-studio-2015,Typescript,Visual Studio 2015,我一直在使用Visual Studio 2013和TS语言的1.4版本进行TypeScript项目。刚才我升级了Visual Studio 2015,它使用TS 1.6 我的代码使用HtmleElement的“disabled”属性: 变量e:HtmleElement=。。。 e、 禁用=真 VS 2015/TS 1.6现在给了我错误代码TS2339:“类型“HtmleElement”上不存在属性“disabled” 哇!disabled是一个DOM属性,它过去在我的代码中做一些事情,现在它不再

我一直在使用Visual Studio 2013和TS语言的1.4版本进行TypeScript项目。刚才我升级了Visual Studio 2015,它使用TS 1.6

我的代码使用HtmleElement的“disabled”属性: 变量e:HtmleElement=。。。 e、 禁用=真

VS 2015/TS 1.6现在给了我错误代码TS2339:“类型“HtmleElement”上不存在属性“disabled”

哇!disabled是一个DOM属性,它过去在我的代码中做一些事情,现在它不再被定义了?它去了哪里,我该如何处理


我已经仔细阅读了TS从1.4版到1.6版的“新增内容”说明,但它对此没有任何说明。

对应于,类
HTMLElement
没有
禁用
等属性。这就是为什么Typescript开发团队更正此Web API对象的原因。

HTMLElement
接口没有不包含
disabled
属性,因为它不是一个对所有HTML元素都有意义的属性。但是,它的子元素
HTMLInputElement
htmlButtoneElement
等有意义,因为
disabled
属性对它们有意义


考虑到这一点,您应该能够轻松地更正代码。

我现在明白了,谢谢。有趣的是,我一直在禁用HTMLdevelment,在TS 1.4中,它确实“做了一些事情”…它似乎自动级联到div的子元素。但好的,我完全支持以正确的方式做事情。。。