Skip to content

Commit

Permalink
fix: 修复图片描边宽度slide样式问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiu-Jun committed May 27, 2024
1 parent 627e72a commit 5a2414c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/imgStroke.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
</iSwitch>
</div>
<div class="operation">
<div class="hd">
<div class="hd" style="flex-basis: 98px">
<span>描边大小</span>
</div>
<div class="flex-1">
<div style="width: 100%">
<Slider v-model="strokeWidth" :max="50" @on-change="onSliderChange"></Slider>
</div>
</div>

<div class="operation" style="justify-content: flex-start">
<div class="operation" style="justify-content: space-between">
<div class="hd">
<span>描边颜色</span>
</div>
Expand All @@ -62,6 +62,7 @@
<script name="ImgStroke" lang="ts" setup>
import useSelect from '@/hooks/select';
import { fabric } from 'fabric';
import { Slider } from 'view-ui-plus';
interface IActiveCanvas extends fabric.Canvas {
[x: string]: any;
Expand All @@ -76,7 +77,8 @@ const openImgStroke = ref(false);
const strokeWidth = ref(5);
const strokeColor = ref('#000');
const isOnlyStroke = ref(false);
const getActiveObject = () => canvasEditor.canvas.getActiveObjects()[0] as unknown as IActiveCanvas;
const getActiveObject = () =>
canvasEditor.canvas?.getActiveObjects()[0] as unknown as IActiveCanvas;
const setOrigin = () => {
const _activeObject = getActiveObject();
Expand Down Expand Up @@ -212,6 +214,9 @@ async function addImage(src: string): Promise<HTMLImageElement | undefined> {
display: flex;
justify-content: space-between;
align-items: center;
.slide-wrap {
width: 100%;
}
}
}
</style>

0 comments on commit 5a2414c

Please sign in to comment.