mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
fix: 解决通过style设置height, width不生效的bug && style优先级
fix: 解决通过style设置height, width不生效的bug && 并且style优先级高于标签height和width属性。 现在的实现是,即使不在外层设置height, width,他两也被设置成100%了,height !== void 0 成立了,在style里设置height 和 width就不生效了。
This commit is contained in:
parent
f463b0c339
commit
4673918e51
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user