chore: 构建大小写问题

This commit is contained in:
橙子
2024-01-25 20:32:01 +08:00
parent 10823b3c98
commit add74b0ad0
5 changed files with 172 additions and 124 deletions

View File

@@ -1,83 +1,83 @@
<template> <template>
<div class="common-layout"> <div class="common-layout">
<el-container class="common-container"> <el-container class="common-container">
<el-header <el-header
class="common-header" class="common-header"
ref="header" ref="header"
:class="[isFixed ? 'fixed' : '']" :class="[isFixed ? 'fixed' : '']"
> >
<AppHeader /> <AppHeader />
</el-header> </el-header>
<el-main class="common-main"> <el-main class="common-main">
<SignBody /> <ActivityBody />
</el-main> </el-main>
</el-container> </el-container>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import AppHeader from "../AppHeader.vue"; import AppHeader from "../AppHeader.vue";
import SignBody from "./components/signBody.vue"; import ActivityBody from "./components/ActivityBody.vue";
const header = ref(null); const header = ref(null);
const isFixed = ref(false); const isFixed = ref(false);
onMounted(() => { onMounted(() => {
window.addEventListener("scroll", handleScroll); window.addEventListener("scroll", handleScroll);
}); });
const handleScroll = () => { const handleScroll = () => {
const scrollTop = const scrollTop =
window.scrollY || window.scrollY ||
document.documentElement.scrollTop || document.documentElement.scrollTop ||
document.body.scrollTop; document.body.scrollTop;
const currentEle = header.value.$el; const currentEle = header.value.$el;
if (scrollTop > currentEle.offsetTop) { if (scrollTop > currentEle.offsetTop) {
isFixed.value = true; isFixed.value = true;
} else { } else {
isFixed.value = false; isFixed.value = false;
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.common { .common {
&-layout { &-layout {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
&-container { &-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
&-header { &-header {
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
box-shadow: rgba(0, 0, 0, 0.1) -4px 9px 25px -6px; box-shadow: rgba(0, 0, 0, 0.1) -4px 9px 25px -6px;
height: 60px; height: 60px;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
&-main { &-main {
display: flex; display: flex;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
height: calc(100% - 50px); height: calc(100% - 50px);
} }
} }
.el-main { .el-main {
margin: 0; margin: 0;
padding: 0; padding: 0;
min-height: 10rem; min-height: 10rem;
background-color: #f0f2f5; background-color: #f0f2f5;
} }
.fixed { .fixed {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 99999; z-index: 99999;
} }
</style> </style>

View File

@@ -1,32 +1,36 @@
<template> <template>
<div class="sign-box"> <div class="sign-box">
<div class="menuList">菜单栏</div> <div class="menuList">
<div class="page"> <ActivityNav/>
<RouterView /> </div>
</div> <div class="page">
</div> <RouterView />
</template> </div>
</div>
<script setup></script> </template>
<style lang="scss" scoped> <script setup>
.sign-box { import ActivityNav from './ActivityNav.vue'
display: flex; </script>
justify-content: space-between;
width: 1300px; <style lang="scss" scoped>
height: 100%; .sign-box {
padding: 20px 0 10px; display: flex;
.menuList { justify-content: space-between;
width: 25%; width: 1300px;
height: 100%; height: 100%;
background-color: #fff; padding: 20px 0 10px;
border-radius: 5px; .menuList {
} width: 20%;
.page { height: 100%;
width: 70%; background-color: #fff;
height: 100%; border-radius: 5px;
background-color: #fff; }
border-radius: 5px; .page {
} width: 75%;
} height: 100%;
</style> background-color: #fff;
border-radius: 5px;
}
}
</style>

View File

@@ -0,0 +1,44 @@
<template>
<el-menu
default-active="1"
class="el-menu-vertical-demo"
@open="handleOpen"
@close="handleClose"
>
<el-menu-item index="1">
<el-icon><Present /></el-icon>
<span>每日签到</span>
</el-menu-item>
<el-menu-item index="2">
<el-icon><Memo /></el-icon>
<span>任务列表</span>
</el-menu-item>
<el-menu-item index="3">
<el-icon><HelpFilled /></el-icon>
<span>大转盘</span>
</el-menu-item>
<el-menu-item index="4">
<el-icon><Sunrise /></el-icon>
<span>娱乐城</span>
</el-menu-item>
</el-menu>
</template>
<script setup>
const handleOpen = (key, keyPath) => {
console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
console.log(key, keyPath)
}
</script>
<style lang="scss" scoped>
.el-menu-item
{
justify-content: center;
}
.el-menu{
border-right-width: 0px !important;
}
</style>

View File

@@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from "vue-router";
import Layout from "../layout/Index.vue"; import Layout from "../layout/Index.vue";
import NotFound from "../views/error/404.vue"; import NotFound from "../views/error/404.vue";
import LoginLayout from "../layout/LoginLayout.vue"; import LoginLayout from "../layout/LoginLayout.vue";
import SignInLayout from "../layout/signIn/index.vue"; import ActivityLayout from "../layout/activity/Index.vue";
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
scrollBehavior(to, from, savedPosition) { scrollBehavior(to, from, savedPosition) {
@@ -100,15 +100,15 @@ const router = createRouter({
], ],
}, },
{ {
path: "/sign", path: "/activity",
name: "signInLayout", name: "activityLayout",
component: SignInLayout, component: ActivityLayout,
redirect: "/sign/everyday", redirect: "/activity/sign",
children: [ children: [
{ {
name: "everyday", name: "sign",
path: "everyday", path: "sign",
component: () => import("../views/signIn/index.vue"), component: () => import("../views/signIn/Index.vue"),
meta: { meta: {
title: "每日签到", title: "每日签到",
}, },

View File

@@ -296,7 +296,7 @@ const statisOptions = computed(() => {
}); });
const handleToSign = () => { const handleToSign = () => {
router.push("/sign"); router.push("/activity/sign");
}; };
// 推送的实时人数获取 // 推送的实时人数获取