refactor(projects): perfect scrollbar style [完善滚动条]
This commit is contained in:
parent
1bdd81a1d8
commit
1a02cab97c
1828
pnpm-lock.yaml
1828
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,6 @@
|
|||||||
:sider-width="siderWidth"
|
:sider-width="siderWidth"
|
||||||
:sider-collapsed-width="siderCollapsedWidth"
|
:sider-collapsed-width="siderCollapsedWidth"
|
||||||
:sider-collapse="app.siderCollapse"
|
:sider-collapse="app.siderCollapse"
|
||||||
:add-main-overflow-hidden="addMainOverflowHidden"
|
|
||||||
:fixed-footer="theme.footer.fixed"
|
:fixed-footer="theme.footer.fixed"
|
||||||
@update:sider-collapse="app.setSiderCollapse"
|
@update:sider-collapse="app.setSiderCollapse"
|
||||||
>
|
>
|
||||||
@ -23,7 +22,7 @@
|
|||||||
<template #sider>
|
<template #sider>
|
||||||
<global-sider />
|
<global-sider />
|
||||||
</template>
|
</template>
|
||||||
<global-content @hide-main-overflow="setAddMainOverflowHidden" />
|
<global-content />
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<global-footer />
|
<global-footer />
|
||||||
</template>
|
</template>
|
||||||
@ -36,7 +35,6 @@
|
|||||||
import AdminLayout from '@soybeanjs/vue-admin-layout';
|
import AdminLayout from '@soybeanjs/vue-admin-layout';
|
||||||
import { useAppStore, useThemeStore } from '@/store';
|
import { useAppStore, useThemeStore } from '@/store';
|
||||||
import { useBasicLayout } from '@/composables';
|
import { useBasicLayout } from '@/composables';
|
||||||
import { useBoolean } from '@/hooks';
|
|
||||||
import {
|
import {
|
||||||
GlobalBackTop,
|
GlobalBackTop,
|
||||||
GlobalContent,
|
GlobalContent,
|
||||||
@ -53,8 +51,6 @@ const app = useAppStore();
|
|||||||
const theme = useThemeStore();
|
const theme = useThemeStore();
|
||||||
|
|
||||||
const { mode, isMobile, headerProps, siderVisible, siderWidth, siderCollapsedWidth } = useBasicLayout();
|
const { mode, isMobile, headerProps, siderVisible, siderWidth, siderCollapsedWidth } = useBasicLayout();
|
||||||
|
|
||||||
const { bool: addMainOverflowHidden, setBool: setAddMainOverflowHidden } = useBoolean();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -4,13 +4,7 @@
|
|||||||
class="h-full bg-[#f6f9f8] dark:bg-[#101014] transition duration-300 ease-in-out"
|
class="h-full bg-[#f6f9f8] dark:bg-[#101014] transition duration-300 ease-in-out"
|
||||||
>
|
>
|
||||||
<router-view v-slot="{ Component, route }">
|
<router-view v-slot="{ Component, route }">
|
||||||
<transition
|
<transition :name="theme.pageAnimateMode" mode="out-in" :appear="true">
|
||||||
:name="theme.pageAnimateMode"
|
|
||||||
mode="out-in"
|
|
||||||
:appear="true"
|
|
||||||
@before-leave="handleBeforeLeave"
|
|
||||||
@after-enter="handleAfterEnter"
|
|
||||||
>
|
|
||||||
<keep-alive :include="routeStore.cacheRoutes">
|
<keep-alive :include="routeStore.cacheRoutes">
|
||||||
<component :is="Component" v-if="app.reloadFlag" :key="route.fullPath" />
|
<component :is="Component" v-if="app.reloadFlag" :key="route.fullPath" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
@ -33,23 +27,9 @@ withDefaults(defineProps<Props>(), {
|
|||||||
showPadding: true
|
showPadding: true
|
||||||
});
|
});
|
||||||
|
|
||||||
interface Emits {
|
|
||||||
/** 禁止主体溢出 */
|
|
||||||
(e: 'hide-main-overflow', hidden: boolean): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const emit = defineEmits<Emits>();
|
|
||||||
|
|
||||||
const app = useAppStore();
|
const app = useAppStore();
|
||||||
const theme = useThemeStore();
|
const theme = useThemeStore();
|
||||||
const routeStore = useRouteStore();
|
const routeStore = useRouteStore();
|
||||||
|
|
||||||
function handleBeforeLeave() {
|
|
||||||
emit('hide-main-overflow', true);
|
|
||||||
}
|
|
||||||
function handleAfterEnter() {
|
|
||||||
emit('hide-main-overflow', false);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
@import './transition.css';
|
@import './transition.css';
|
||||||
@import './reset.css';
|
@import './reset.css';
|
||||||
|
@import './scrollbar.css';
|
||||||
|
|
||||||
html, body, #app {
|
html, body, #app {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -1,26 +1,53 @@
|
|||||||
/*---滚动条默认显示样式--*/
|
html {
|
||||||
::-webkit-scrollbar-thumb {
|
scrollbar-width: thin;
|
||||||
background-color: #e6e6e6;
|
scrollbar-color: #e1e1e1 transparent;
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
/*---鼠标点击滚动条显示样式--*/
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
background-color: #e6e6e6;
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
/*---滚动条大小--*/
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 6px;
|
|
||||||
height: 6px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*---滚动条默认显示样式--*/
|
||||||
|
html::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #e1e1e1;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
/*---鼠标点击滚动条显示样式--*/
|
||||||
|
html::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #e1e1e1;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
/*---滚动条大小--*/
|
||||||
|
html::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
/*---滚动框背景样式--*/
|
/*---滚动框背景样式--*/
|
||||||
::-webkit-scrollbar-track-piece {
|
html::-webkit-scrollbar-track-piece {
|
||||||
background-color: rgba(0, 0, 0, 0);
|
background-color: rgba(0, 0, 0, 0);
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
|
||||||
|
html.dark {
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
scrollbar-color: e6e6e6 transparent;
|
scrollbar-color: #555 transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---滚动条默认显示样式--*/
|
||||||
|
html.dark::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #555;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
/*---鼠标点击滚动条显示样式--*/
|
||||||
|
html.dark::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #555;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
/*---滚动条大小--*/
|
||||||
|
html.dark::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---滚动框背景样式--*/
|
||||||
|
html.dark::-webkit-scrollbar-track-piece {
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user