gohttpdUi/src/App.vue

65 lines
1.4 KiB
Vue
Raw Normal View History

2021-12-08 10:47:33 +08:00
<script setup lang="ts">
import { computed } from 'vue'
2021-12-31 17:19:53 +08:00
import { useAppStore } from '@/store/modules/app'
import { ConfigGlobal } from '@/components/ConfigGlobal'
import { useDesign } from '@/hooks/web/useDesign'
2023-12-20 10:26:51 +08:00
import { useDark } from '@vueuse/core'
2023-12-25 16:27:55 +08:00
// import { ElNotification } from 'element-plus'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('app')
2021-12-31 17:19:53 +08:00
const appStore = useAppStore()
2022-01-18 16:22:47 +08:00
const currentSize = computed(() => appStore.getCurrentSize)
const greyMode = computed(() => appStore.getGreyMode)
2023-12-20 10:26:51 +08:00
const isDark = useDark({
valueDark: 'dark',
valueLight: 'light'
})
2022-05-10 16:11:48 +08:00
2023-12-20 10:26:51 +08:00
isDark.value = appStore.getIsDark
2023-12-25 16:27:55 +08:00
// ElNotification({
// title: '提示',
// type: 'warning',
// duration: 0,
// dangerouslyUseHTMLString: true,
// message:
// '<div><p><strong>遇事不决,请先查阅常见问题,说不定你能找到相关解答</strong></p><p><a href="https://www.baidu.com" target="_blank">链接地址</a></p></div>'
// })
2021-12-08 10:47:33 +08:00
</script>
<template>
2022-01-18 16:22:47 +08:00
<ConfigGlobal :size="currentSize">
<RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" />
</ConfigGlobal>
</template>
2021-12-31 17:19:53 +08:00
<style lang="less">
@prefix-cls: ~'@{namespace}-app';
2022-01-18 16:22:47 +08:00
2021-12-31 17:19:53 +08:00
.size {
width: 100%;
height: 100%;
}
html,
body {
2022-01-21 16:17:40 +08:00
padding: 0 !important;
2021-12-31 17:19:53 +08:00
margin: 0;
2022-01-13 17:26:06 +08:00
overflow: hidden;
2021-12-31 17:19:53 +08:00
.size;
#app {
.size;
}
}
2022-01-18 16:22:47 +08:00
.@{prefix-cls}-grey-mode {
2022-01-18 16:22:47 +08:00
filter: grayscale(100%);
}
2021-12-31 17:19:53 +08:00
</style>