Blame view

src/layouts/default/header/components/lock/index.vue 1 KB
vben authored
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
<template>
  <span @click="handleLock">
    <Tooltip :title="t('layout.header.tooltipLock')" placement="bottom" :mouseEnterDelay="0.5">
      <LockOutlined />
    </Tooltip>
    <LockAction @register="register" />
  </span>
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { Tooltip } from 'ant-design-vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { LockOutlined } from '@ant-design/icons-vue';
  import { useModal } from '/@/components/Modal';
  import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
  export default defineComponent({
    name: 'FullScreen',
    components: {
      LockOutlined,
      Tooltip,
      LockAction: createAsyncComponent(() => import('./LockModal.vue')),
    },

    setup() {
      const { t } = useI18n();
      const [register, { openModal }] = useModal();

      function handleLock() {
        openModal(true);
      }
      return {
        t,
        register,
        handleLock,
      };
    },
  });
</script>