在iframe类型上不存在webkitAllowFullScreen吗?

时间:2019-04-09 09:28:10

标签: reactjs typescript

以下代码:

<iframe
    style={{
        position: 'absolute',
        top: 0,
        left: 0,
        width: '100%',
        height: '100%',
    }}
    src={props.src}
    frameBorder="0"
    allowFullScreen={props.allowFullscreen}
    webkitAllowFullScreen={props.allowFullscreen}
/>

给出此键入错误:

Type '{ style: { position: "absolute"; top: number; left: number; width: string; height: string; }; src: string; frameBorder: string; allowFullScreen: boolean | undefined; webkitAllowFullScreen: boolean | undefined; }' is not assignable to type 'DetailedHTMLProps<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>'.
  Property 'webkitAllowFullScreen' does not exist on type 'DetailedHTMLProps<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>'.

我该如何解决?

0 个答案:

没有答案