vue-vben-admin/src/App.vue

46 lines
1.2 KiB
Vue
Raw Normal View History

2020-09-28 20:19:10 +08:00
<template>
2020-10-08 01:35:05 +08:00
<ConfigProvider :locale="zhCN" :transformCellText="transformCellText" v-bind="lockOn">
2020-09-28 20:19:10 +08:00
<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';
import 'moment/locale/zh-cn';
import { useConfigProvider, useInitAppConfigStore, useListenerNetWork } from './useApp';
import { useLockPage } from '/@/hooks/web/useLockPage';
2020-10-15 21:12:38 +08:00
import { useSetting } from '/@/hooks/core/useSetting';
2020-09-28 20:19:10 +08:00
moment.locale('zh-cn');
2020-10-19 22:56:10 +08:00
2020-09-28 20:19:10 +08:00
export default defineComponent({
name: 'App',
2020-09-28 20:19:10 +08:00
components: { ConfigProvider },
setup() {
useInitAppConfigStore();
useListenerNetWork();
createBreakpointListen();
2020-10-15 21:12:38 +08:00
const { projectSetting } = useSetting();
2020-10-08 01:35:05 +08:00
const { transformCellText } = useConfigProvider();
2020-10-15 21:12:38 +08:00
let lockOn = {};
if (projectSetting.lockTime) {
const { on } = useLockPage();
lockOn = on;
}
2020-10-18 21:55:21 +08:00
2020-09-28 20:19:10 +08:00
return {
transformCellText,
zhCN,
lockOn,
};
},
});
</script>