Merge remote-tracking branch 'baidu/master'

This commit is contained in:
2betop 2020-09-03 11:46:02 +08:00
commit ed408b7817
2 changed files with 8 additions and 4 deletions

View File

@ -27,6 +27,8 @@ order: 51
| frameBorder | `Array` | | frameBorder |
| style | `object` | | 样式 |
| src | `string` | | iframe地址 |
| height | `string` | `"100%"` | iframe高 |
| width | `string` | `"100%"` | iframe宽 |

View File

@ -120,13 +120,15 @@ export default class IFrame extends React.Component<IFrameProps, object> {
const {width, height} = this.state;
let {className, src, frameBorder, data, style} = this.props;
let tempStyle: any = {};
width !== void 0 && (tempStyle.width = width);
height !== void 0 && (tempStyle.height = height);
style = {
...tempStyle,
...style
};
width !== void 0 && (style.width = width);
height !== void 0 && (style.height = height);
return (
<iframe
className={className}