代码优化

This commit is contained in:
kron
2026-01-12 15:03:20 +08:00
parent 4771f53d71
commit a2674aae5b
5 changed files with 62 additions and 66 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref, onMounted } from "vue";
import { capsuleHeight } from "@/util";
const props = defineProps({
type: {
type: Number,
@@ -10,11 +11,6 @@ const props = defineProps({
default: "#050b19",
},
});
const capsuleHeight = ref(0);
onMounted(() => {
const menuBtnInfo = uni.getMenuButtonBoundingClientRect();
capsuleHeight.value = menuBtnInfo.top + 50 - 9;
});
</script>
<template>
@@ -35,7 +31,7 @@ onMounted(() => {
class="bg-image"
v-if="type === 2"
src="../static/app-bg3.png"
:style="{ height: capsuleHeight + 'px' }"
:style="{ height: capsuleHeight + 50 + 'px' }"
/>
<image
class="bg-image"