File size: 716 Bytes
b5ba7a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<script lang="ts">
import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons-vue';
import IconSwitch from './IconSwitch.vue';

export default {
  props: {
    visible: {
      type: Boolean,
      required: true,
    },
  },
  components: {
    EyeOutlined, EyeInvisibleOutlined, IconSwitch,
  },
};
</script>

<template>
    <div class="visible-switch" title="Toggle visibility">
        <IconSwitch :model-value="visible" @update:modelValue="$emit('update:visible', $event)">
          <template #enable-state>
            <eye-outlined/>
          </template>
          <template #disable-state>
            <eye-invisible-outlined/>
          </template>
        </IconSwitch>
    </div>
</template>