moblie-website/src/components/Header.vue

37 lines
1016 B
Vue
Raw Normal View History

2025-01-21 23:37:04 +08:00
<template>
2025-02-15 21:04:05 +08:00
<div class="navbar header-bg-color">
<div class="navbar-start"></div>
<div class="navbar-center">
<a class="btn btn-ghost btn-hover" :style="{ color: activeTag === 'about' ? '#00E5FF' : 'white' }">关于三优</a>
<a class="btn btn-ghost btn-hover" :style="{ color: activeTag === 'home' ? '#00E5FF' : 'white' }">三优云试剂管家</a>
<a class="btn btn-ghost btn-hover" :style="{ color: activeTag === 'contact' ? '#00E5FF' : 'white' }">联系我们</a>
2025-01-21 23:37:04 +08:00
</div>
2025-02-15 21:04:05 +08:00
<div class="navbar-end"></div>
</div>
2025-01-21 23:37:04 +08:00
</template>
<script setup>
2025-02-15 21:04:05 +08:00
import { defineProps } from "vue";
// 接收父组件传递的 activeTag
const props = defineProps({
activeTag: {
type: String,
default: "home", // 可以定义默认值
},
});
2025-01-21 23:37:04 +08:00
</script>
<style scoped>
2025-02-15 21:04:05 +08:00
.header-bg-color {
color: #fff;
font-size: 16px;
height: 77px;
z-index: 111;
position: relative;
}
.btn-hover:hover {
color: #00E5FF !important;
}
2025-01-21 23:37:04 +08:00
/* 你可以在这里添加一些自定义的样式 */
</style>