代码优化
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user