fix: 修改背景图覆盖不全的问题

This commit is contained in:
奔跑的面条 2022-07-26 15:35:23 +08:00
parent 0067d4fd5a
commit 2de57e93f5
2 changed files with 3 additions and 17 deletions

View File

@ -1,9 +1,5 @@
<template>
<div
class="go-edit-range go-transition"
:style="rangeStyle"
@mousedown="mousedownHandleUnStop($event, undefined)"
>
<div class="go-edit-range go-transition" :style="rangeStyle" @mousedown="mousedownHandleUnStop($event, undefined)">
<slot></slot>
<!-- 水印 -->
<edit-watermark></edit-watermark>
@ -41,18 +37,8 @@ const rangeStyle = computed(() => {
const scale = {
transform: `scale(${getEditCanvas.value.scale})`
}
//
const background = getEditCanvasConfig.value.background
const backgroundImage = getEditCanvasConfig.value.backgroundImage
const selectColor = getEditCanvasConfig.value.selectColor
const backgroundColor = background ? background : undefined
const computedBackground = selectColor
? { background: backgroundColor }
: { background: `url(${backgroundImage}) no-repeat center/100% !important` }
// @ts-ignore
return { ...useSizeStyle(size.value), ...computedBackground, ...scale }
return { ...useSizeStyle(size.value), ...scale }
})
//

View File

@ -111,7 +111,7 @@ const rangeStyle = computed(() => {
const computedBackground = selectColor
? { background: backgroundColor }
: { background: `url(${backgroundImage}) no-repeat center/100% !important` }
: { background: `url(${backgroundImage}) no-repeat center center / cover !important` }
// @ts-ignore
return {