zhengyiming
11 小时以前 d7c8a3a9e1fc5c8e596a17cdadb7079d20e52297
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script setup lang="ts">
import useSelect from '@/hooks/select';
const { isMatchType, canvasEditor } = useSelect(['polygon']);
import { Message } from 'view-ui-plus';
const onEditPolygon = () => {
  const obj = canvasEditor.fabricCanvas?.getActiveObject();
  if (obj && obj.type === 'polygon') {
    canvasEditor.activeEdit();
  } else {
    Message.warning('请检查选择polygon');
  }
};
</script>
 
<template>
  <Tooltip :content="$t('quick.editPoly')" v-if="isMatchType">
    <Button long @click="onEditPolygon" icon="md-brush" type="text"></Button>
  </Tooltip>
</template>
 
<style scoped lang="less"></style>