Blame view

src/App.vue 1.39 KB
陈文彬 authored
1
<template>
vben authored
2
  <ConfigProvider :locale="zhCN" :transform-cell-text="transformCellText" v-bind="lockOn">
陈文彬 authored
3
4
5
6
7
8
9
10
11
12
13
    <router-view />
  </ConfigProvider>
</template>

<script lang="ts">
  import { defineComponent } from 'vue';
  import { ConfigProvider } from 'ant-design-vue';
  import { createBreakpointListen } from '/@/hooks/event/useBreakpoint';

  import zhCN from 'ant-design-vue/es/locale/zh_CN';
  import moment from 'moment';
14
  import 'moment/dist/locale/zh-cn';
陈文彬 authored
15
16
  import { useConfigProvider, useInitAppConfigStore } from './useApp';
陈文彬 authored
17
  import { useLockPage } from '/@/hooks/web/useLockPage';
vben authored
18
19
  import { useSetting } from '/@/hooks/core/useSetting';
陈文彬 authored
20
  moment.locale('zh-cn');
21
陈文彬 authored
22
  export default defineComponent({
23
    name: 'App',
陈文彬 authored
24
25
    components: { ConfigProvider },
    setup() {
vben authored
26
      // Initialize application settings
陈文彬 authored
27
      useInitAppConfigStore();
vben authored
28
      // Initialize breakpoint monitoring
陈文彬 authored
29
      createBreakpointListen();
vben authored
30
      // Get system configuration
vben authored
31
      const { projectSetting } = useSetting();
vben authored
32
      // Get ConfigProvider configuration
33
      const { transformCellText } = useConfigProvider();
vben authored
34
35
36

      let lockOn = {};
      if (projectSetting.lockTime) {
vben authored
37
        // Monitor the mouse or keyboard time, used to recalculate the lock screen time
vben authored
38
39
40
        const { on } = useLockPage();
        lockOn = on;
      }
vben authored
41
陈文彬 authored
42
43
44
45
46
47
48
49
      return {
        transformCellText,
        zhCN,
        lockOn,
      };
    },
  });
</script>