图片背景组件

/*************************************/

使用: 

<jb-img-map-bg :bg-width="width" :bg-height="height" class="topoBgImage"></jb-img-map-bg>
.topoBgImage
z-index -1
position absolute

/*************************************/
<template>
<div>
<el-image
:style="bmapStyle"
:src="url"
fit="fill"></el-image>
</div>
</template>

<script>
export default {
name: 'ImageMapBg',
props: {
bgWidth: {
type: Number,
require: true
},
bgHeight: {
type: Number,
require: true
}
},
data () {
return {
url: '/static/assets/topo/bg_world.bmp'
}
},
computed: {
bmapStyle () {
return { width: this.bgWidth + 'px', height: this.bgHeight + 'px' }
}
}
}
</script>

<style scoped>

</style>
posted @ 2021-07-01 16:30  w20200618  阅读(48)  评论(0)    收藏  举报