zhengyiming
17 小时以前 745f1e2ee7072731611391b89c5c0020783828bf
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!--
 * @Author: 秦少卫
 * @Date: 2022-04-21 20:20:20
 * @LastEditors: 秦少卫
 * @LastEditTime: 2023-08-05 18:44:54
 * @Description: 缩放元素
-->
<template>
  <div class="box">
    <ButtonGroup>
      <Button @click="big">
        <bigIcon width="14" height="14"></bigIcon>
      </Button>
      <Button @click="small">
        <smallIcon width="14" height="14"></smallIcon>
      </Button>
      <Button @click="rSet" icon="ios-expand"></Button>
      <Button @click="setViewport" icon="md-contract"></Button>
    </ButtonGroup>
  </div>
</template>
 
<script setup name="Zoom">
import useSelect from '@/hooks/select';
import bigIcon from '@/assets/icon/zoom/big.svg';
import smallIcon from '@/assets/icon/zoom/small.svg';
 
const { canvasEditor } = useSelect();
 
const rSet = () => {
  canvasEditor.one();
};
const big = () => {
  canvasEditor.big();
};
const small = () => {
  canvasEditor.small();
};
const setViewport = () => {
  canvasEditor.auto();
};
</script>
<style scoped lang="less">
.box {
  position: absolute;
  right: 10px;
  bottom: 10px;
 
  :deep(.ivu-btn:hover) {
    svg {
      fill: #57a3f3;
    }
  }
}
</style>