<template>
    <div class="hc-gradient-card-box">
        <div class="flex radius hc-gradient-card" :class="'bg-' + bgColor + '-gradient'">
            <div class="hc-card-dot hc-card-dot1" :class="'bg-' + bgColor + '-gradient'"/>
            <div class="hc-card-dot hc-card-dot2" :class="'bg-' + bgColor + '-gradient'"/>
            <div class="hc-card-dot hc-card-dot3" :class="'bg-' + bgColor + '-gradient'"/>
            <div class="hc-card-main">
                <slot></slot>
            </div>
        </div>
        <div class="hc-gradient-card-bg" :class="'bg-' + bgColor"/>
    </div>
</template>

<script setup>
import {ref, watch} from "vue"

//初始
const props = defineProps({
    color: {
        type: String,
        default: 'blue'
    }
})

const bgColor = ref(props.color)

//监听
watch(() => [
    props.color,
], ([color]) => {
    bgColor.value = color
})
</script>

<style lang="scss" scoped>
@import "./style.scss";
</style>
