<template>
    <div class="map-legend">
        <div
            v-for="item in legendList"
            :key="item.label"
            class="legend-item"
        >
            <span class="legend-dot" :style="{ backgroundColor: item.color }"></span>
            <span class="legend-label">{{ item.label }}</span>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';

const legendImg = ref('');

const legendList = ref([
    { label: '抽穗期', color: '#E17C00' },
    { label: '拔节期', color: '#985300' },
    { label: '孕穗期', color: '#512D00' }
]);
</script>

<style lang="scss" scoped>
.map-legend {
    position: fixed;
    bottom: 18px;
    right: 460px;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    z-index: 9;
    color: #ffffff;
    .legend-item {
        display: flex;
        align-items: center;
        gap: 8px;
        .legend-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #f2a038; // 默认颜色，实际由内联样式覆盖
        }
    }
}


</style>