【发布时间】:2021-10-20 11:18:10
【问题描述】:
我在 reactJS 中有一个视频标签。
<video {props.flag == true && "controls"}>
<source src= "/videos/video_tab.mp4" type="video/mp4"/>
Your browser does not support the video tag.
</video>
React 给我
{props.flag == true && "controls"}的错误是 语法不正确
据我们所知,我们可以在基本的 html 中获得控件,例如
<video controls>
<source src= "/videos/video_tab.mp4" type="video/mp4"/>
Your browser does not support the video tag.
</video>
但我只想在 props.flag == true 默认为 false 时显示控件。
我该怎么做?
【问题讨论】:
标签: reactjs html5-video