From f87151a44e673dac125404fb1c8809679f390aef Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Mon, 12 Oct 2020 09:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20fix:=20=E4=BF=AE=E5=A4=8Diframe?= =?UTF-8?q?=20attributes=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this.options = extend(this._defaultConfig(config), props, config); options的生成是浅extend,如果外部也传了attributes 属性就被覆盖了 --- src/base/single/iframe/iframe.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/base/single/iframe/iframe.js b/src/base/single/iframe/iframe.js index 49daf5715c..69d131b650 100644 --- a/src/base/single/iframe/iframe.js +++ b/src/base/single/iframe/iframe.js @@ -12,18 +12,17 @@ BI.Iframe = BI.inherit(BI.Single, { baseCls: (conf.baseCls || "") + " bi-iframe", src: "", name: "", - attributes: { - frameborder: 0, - src: config.src, - name: config.name - }, + attributes: {}, width: "100%", height: "100%" }); }, _init: function () { - var self = this; + var self = this, o = this.options; + o.attributes.frameborder = "0"; + o.attributes.src = o.src; + o.attributes.name = o.name; BI.Iframe.superclass._init.apply(this, arguments); this.element.on("load", function () { self.fireEvent("EVENT_LOADED");