Skip to content

Commit

Permalink
fix: 图层重复问题以及fabricGradientToCss val空值导致报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiu-Jun committed Jan 31, 2024
1 parent b00ea43 commit 87eaf33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/components/colorSelector.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--
* @Author: 秦少卫
* @Date: 2023-02-16 22:52:00
* @LastEditors: 秦少卫
* @LastEditTime: 2023-07-24 23:15:36
* @LastEditors: June
* @LastEditTime: 2024-01-31 12:46:50
* @Description: 颜色选择器
-->
<template>
Expand Down Expand Up @@ -184,6 +184,7 @@ const fabricGradientToBar = (val) => {
// Fabric渐变转css
const fabricGradientToCss = (val, activeObject) => {
// 渐变类型
if (!val) return;
currentGradient.type = val.type;
currentGradient.degree = activeObject.get(props.angleKey, val.degree);
currentGradient.points = val.colorStops.map((item) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/history.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--
* @Author: 秦少卫
* @Date: 2022-09-03 19:16:55
* @LastEditors: 秦少卫
* @LastEditTime: 2023-07-16 12:31:25
* @LastEditors: June
* @LastEditTime: 2024-01-31 12:29:07
* @Description: 回退重做
-->

Expand Down
6 changes: 4 additions & 2 deletions src/components/layer.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--
* @Author: 秦少卫
* @Date: 2022-09-03 19:16:55
* @LastEditors: 秦少卫
* @LastEditTime: 2023-07-24 23:13:51
* @LastEditors: June
* @LastEditTime: 2024-01-31 12:43:22
* @Description: 图层面板
-->

Expand Down Expand Up @@ -42,6 +42,7 @@
</template>

<script setup name="Layer">
import { uniqBy } from 'lodash-es';
import useSelect from '@/hooks/select';
const { canvasEditor, fabric, mixinState } = useSelect();

Expand Down Expand Up @@ -142,6 +143,7 @@ const getList = () => {
text,
};
});
list.value = uniqBy(unref(list), 'id');
};

onMounted(() => {
Expand Down

0 comments on commit 87eaf33

Please sign in to comment.