1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| <template>
| <el-tooltip v-if="isSelect && isMatchType" :content="'删除'">
| <el-button @click="del" icon="Delete" text></el-button>
| </el-tooltip>
| </template>
|
| <script setup name="Del">
| import useSelect from '@/fabric-editor/hooks/select';
| import { debounce } from 'lodash';
| import { TemplateParamObjectName } from '@/fabric-editor/customObject';
|
| // 可修改的元素
| const baseType = [
| 'text',
| 'i-text',
| 'textbox',
| 'rect',
| 'circle',
| 'triangle',
| 'polygon',
| // 'image',
| 'group',
| 'line',
| 'arrow',
| 'thinTailArrow',
| TemplateParamObjectName,
| ];
| const { isMatchType, canvasEditor, isSelect, isOne } = useSelect(baseType);
|
| const del = debounce(function () {
| canvasEditor.del();
| }, 300);
| </script>
|
|