|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="image-style-panel">
|
|
|
- <div
|
|
|
+ <div
|
|
|
class="origin-image"
|
|
|
:style="{ backgroundImage: `url(${handleImageElement.src})` }"
|
|
|
></div>
|
|
@@ -14,9 +14,9 @@
|
|
|
<div class="clip">
|
|
|
<div class="title">按形状:</div>
|
|
|
<div class="shape-clip">
|
|
|
- <div
|
|
|
- class="shape-clip-item"
|
|
|
- v-for="(item, key) in shapeClipPathOptions"
|
|
|
+ <div
|
|
|
+ class="shape-clip-item"
|
|
|
+ v-for="(item, key) in shapeClipPathOptions"
|
|
|
:key="key"
|
|
|
@click="presetImageClip(key as string)"
|
|
|
>
|
|
@@ -27,7 +27,7 @@
|
|
|
<template v-for="typeItem in ratioClipOptions" :key="typeItem.label">
|
|
|
<div class="title" v-if="typeItem.label">按{{typeItem.label}}:</div>
|
|
|
<ButtonGroup class="row">
|
|
|
- <Button
|
|
|
+ <Button
|
|
|
style="flex: 1;"
|
|
|
v-for="item in typeItem.children"
|
|
|
:key="item.key"
|
|
@@ -40,13 +40,13 @@
|
|
|
<Button last class="popover-btn" style="width: 100%;"><IconDown /></Button>
|
|
|
</Popover>
|
|
|
</ButtonGroup>
|
|
|
-
|
|
|
+
|
|
|
<div class="row">
|
|
|
<div style="width: 40%;">圆角半径:</div>
|
|
|
- <NumberInput
|
|
|
- :value="handleImageElement.radius || 0"
|
|
|
- @update:value="value => updateImage({ radius: value })"
|
|
|
- style="width: 60%;"
|
|
|
+ <NumberInput
|
|
|
+ :value="handleImageElement.radius || 0"
|
|
|
+ @update:value="value => updateImage({ radius: value })"
|
|
|
+ style="width: 60%;"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
@@ -59,7 +59,7 @@
|
|
|
<Divider />
|
|
|
<ElementShadow />
|
|
|
<Divider />
|
|
|
-
|
|
|
+
|
|
|
<FileInput @change="files => replaceImage(files)">
|
|
|
<Button class="full-width-btn"><IconTransform class="btn-icon" /> 替换图片</Button>
|
|
|
</FileInput>
|
|
@@ -182,7 +182,7 @@ const presetImageClip = (shape: string, ratio = 0) => {
|
|
|
originLeft,
|
|
|
originTop,
|
|
|
} = getImageElementDataBeforeClip()
|
|
|
-
|
|
|
+
|
|
|
// 纵横比裁剪(形状固定为矩形)
|
|
|
if (ratio) {
|
|
|
const imageRatio = originHeight / originWidth
|
|
@@ -261,10 +261,8 @@ const setBackgroundImage = () => {
|
|
|
const background: SlideBackground = {
|
|
|
...currentSlide.value.background,
|
|
|
type: 'image',
|
|
|
- image: {
|
|
|
- src: _handleElement.src,
|
|
|
- size: 'cover'
|
|
|
- },
|
|
|
+ image: _handleElement.src,
|
|
|
+ imageSize: "cover"
|
|
|
}
|
|
|
slidesStore.updateSlide({ background })
|
|
|
addHistorySnapshot()
|
|
@@ -331,4 +329,4 @@ const setBackgroundImage = () => {
|
|
|
.popover-btn {
|
|
|
padding: 0 3px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|