提交 d5b76892 作者: vben

fix(lock): automatic screen lock does not work

上级 785732f4
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
- 修复黑暗主题刷新闪烁的白屏 - 修复黑暗主题刷新闪烁的白屏
- 修复标签页关闭其他功能失效问题 - 修复标签页关闭其他功能失效问题
- 修复表单已知问题 - 修复表单已知问题
- 修复自动锁屏失效
## 2.3.0 (2021-04-10) ## 2.3.0 (2021-04-10)
......
<template> <template>
<ConfigProvider v-bind="lockEvent" :locale="getAntdLocale"> <ConfigProvider :locale="getAntdLocale">
<AppProvider> <AppProvider>
<RouterView /> <RouterView />
</AppProvider> </AppProvider>
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
import { ConfigProvider } from 'ant-design-vue'; import { ConfigProvider } from 'ant-design-vue';
import { AppProvider } from '/@/components/Application'; import { AppProvider } from '/@/components/Application';
import { useLockPage } from '/@/hooks/web/useLockPage';
import { useTitle } from '/@/hooks/web/useTitle'; import { useTitle } from '/@/hooks/web/useTitle';
import { useLocale } from '/@/locales/useLocale'; import { useLocale } from '/@/locales/useLocale';
...@@ -24,10 +23,7 @@ ...@@ -24,10 +23,7 @@
// support Multi-language // support Multi-language
const { getAntdLocale } = useLocale(); const { getAntdLocale } = useLocale();
// Create a lock screen monitor return { getAntdLocale };
const lockEvent = useLockPage();
return { getAntdLocale, lockEvent };
}, },
}); });
</script> </script>
<template> <template>
<Layout :class="prefixCls"> <Layout :class="prefixCls" v-bind="lockEvents">
<LayoutFeatures /> <LayoutFeatures />
<LayoutHeader fixed v-if="getShowFullHeaderRef" /> <LayoutHeader fixed v-if="getShowFullHeaderRef" />
<Layout :class="layoutClass"> <Layout :class="layoutClass">
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting'; import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting';
import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'; import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
import { useDesign } from '/@/hooks/web/useDesign'; import { useDesign } from '/@/hooks/web/useDesign';
import { useLockPage } from '/@/hooks/web/useLockPage';
import { useAppInject } from '/@/hooks/web/useAppInject'; import { useAppInject } from '/@/hooks/web/useAppInject';
...@@ -45,6 +46,10 @@ ...@@ -45,6 +46,10 @@
const { getIsMobile } = useAppInject(); const { getIsMobile } = useAppInject();
const { getShowFullHeaderRef } = useHeaderSetting(); const { getShowFullHeaderRef } = useHeaderSetting();
const { getShowSidebar, getIsMixSidebar } = useMenuSetting(); const { getShowSidebar, getIsMixSidebar } = useMenuSetting();
// Create a lock screen monitor
const lockEvents = useLockPage();
const layoutClass = computed(() => ({ 'ant-layout-has-sider': unref(getIsMixSidebar) })); const layoutClass = computed(() => ({ 'ant-layout-has-sider': unref(getIsMixSidebar) }));
return { return {
...@@ -54,6 +59,7 @@ ...@@ -54,6 +59,7 @@
getIsMobile, getIsMobile,
getIsMixSidebar, getIsMixSidebar,
layoutClass, layoutClass,
lockEvents,
}; };
}, },
}); });
......
...@@ -26,7 +26,7 @@ if (import.meta.env.DEV) { ...@@ -26,7 +26,7 @@ if (import.meta.env.DEV) {
(async () => { (async () => {
const app = createApp(App); const app = createApp(App);
// Configure vuex store // Configure store
setupStore(app); setupStore(app);
// Initialize internal system configuration // Initialize internal system configuration
...@@ -55,8 +55,4 @@ if (import.meta.env.DEV) { ...@@ -55,8 +55,4 @@ if (import.meta.env.DEV) {
await router.isReady(); await router.isReady();
app.mount('#app', true); app.mount('#app', true);
if (import.meta.env.DEV) {
window.__APP__ = app;
}
})(); })();
...@@ -16,10 +16,10 @@ declare global { ...@@ -16,10 +16,10 @@ declare global {
}; };
lastBuildTime: string; lastBuildTime: string;
}; };
declare interface Window { // declare interface Window {
// Global vue app instance // // Global vue app instance
__APP__: App<Element>; // __APP__: App<Element>;
} // }
// vue // vue
declare type PropType<T> = VuePropType<T>; declare type PropType<T> = VuePropType<T>;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论