Mar*_*ark 6 html javascript frontend typescript ecmascript-6
我正在使用 Typescript 和 NextJS,我想添加tabIndex = '0'其中一个 div。但出现此错误Type 'string' is not assignable to type 'number'...如何实现此目的?
\xe2\x80\xb9div className= 'container' tabIndex = '0'>\nRun Code Online (Sandbox Code Playgroud)\n
相反tabIndex='0',您应该将其写为tabIndex={0}. 这样 Ty[escript 就会理解。
<div className="container tabIndex={0}>