增加背景图片宽高

master
张博文 2 days ago
parent 10624e8d19
commit d18c244339

@ -64,6 +64,8 @@
<img :src="form.bgUrl" alt="扫码记录图标" v-if="form.bgUrl" style="width: 100px;height: 100px;">
<i class="el-icon-plus" v-if="!form.bgUrl"></i>
</div>
<span>背景图片高度: {{ form.bgHeight }}px</span><br />
<span>背景图片宽度: {{ form.bgWidth }}px</span>
</el-form-item>
<!-- 节点配置 -->
@ -579,6 +581,16 @@
this.form.templateItemList[this.selectMaterialType.split(",")[1]].iconUrl = this.selectedMaterialUrl;
} else {
this.form[this.selectMaterialType] = this.selectedMaterialUrl;
if (this.selectMaterialType === 'bgUrl') {
const that = this;
const img = new Image();
img.src = this.selectedMaterialUrl;
img.onload = function() {
//
that.form.bgWidth = this.width;
that.form.bgHeight = this.height;
}
}
}
this.selectMaterialVisible = false;
},

Loading…
Cancel
Save