Ver código fonte

更新全局样式

Ryuiso 8 meses atrás
pai
commit
653b99ee17

+ 1 - 0
web/src/App.vue

@@ -32,5 +32,6 @@ const showFooter = computed(() => route.name !== 'doc') // 在文档页面不显
 
 .main-content {
   flex: 1;
+  margin-top: var(--header-height, 64px); /* 使用margin-top而不是padding-top */
 }
 </style>

+ 4 - 1
web/src/assets/styles/variables.scss

@@ -40,7 +40,10 @@ $spacing-xxl: 40px;
 $spacing-xxxl: 60px;
 
 // Layout
-$header-height: 60px;
+$header-height: 64px;
+:root {
+  --header-height: #{$header-height};
+}
 $footer-height: 60px;
 $container-width: 1200px;
 $sidebar-width: 256px;

+ 2 - 1
web/src/layout/NewHeader/index.vue

@@ -136,6 +136,7 @@ const handleMenuLeave = (index: number) => {
 <style scoped lang="scss">
 @use '@/assets/styles/variables' as v;
 @use '@/assets/styles/mixins' as m;
+@use "sass:color";
 
 .new-header {
   position: fixed;
@@ -306,7 +307,7 @@ const handleMenuLeave = (index: number) => {
   transition: background-color v.$transition-fast;
 
   &:hover {
-    background-color: darken(v.$primary-color, 10%);
+    background-color: color.adjust(v.$primary-color, $lightness: -10%);
   }
 }
 </style>

+ 8 - 4
web/src/router/index.ts

@@ -4,12 +4,16 @@ import HomeView from '@/views/Home/index.vue'
 import EnterpriseView from '@/views/Enterprise/index.vue'
 import DocView from '@/views/Doc/index.vue'
 
-export interface NavItem extends RouteRecordRaw {
+export interface NavItem {
+  path: string
+  name: string
+  component: any
   title: string
   showInNav: boolean
+  meta?: Record<string, any>
 }
 
-const routes: NavItem[] = [
+const routes: (NavItem & RouteRecordRaw)[] = [
   {
     path: '/',
     name: 'home',
@@ -19,7 +23,7 @@ const routes: NavItem[] = [
   },
   {
     path: '/enterprise',
-    nema: 'enterprise',
+    name: 'enterprise',
     component: EnterpriseView,
     title: '行业案例',
     showInNav: true
@@ -38,7 +42,7 @@ const routes: NavItem[] = [
 
 const router = createRouter({
   history: createWebHistory(import.meta.env.BASE_URL),
-  routes: routes as RouteRecordRaw[]
+  routes
 })
 
 export default router