<template>
  <el-form-item label="颜色：">
    <el-color-picker v-model="value" color-format="rgba" show-alpha />
  </el-form-item>
</template>
<script setup lang="ts">
import { ref, watchEffect } from "vue";
import { BoardShape } from "../board";
import { ElColorPicker } from "element-plus";

const props = defineProps<{ shape: BoardShape }>();
const emit = defineEmits<{ (e: "blur"): void }>();
const value = ref<string>(props.shape.data.color || "rgba(0,0,0,1)");

watchEffect(() => {
  console.log(value.value);
  props.shape.setColor(value.value);
});
</script>
