This commit is contained in:
Your Name
2026-03-01 14:17:59 +08:00
parent 65aa12f146
commit a07e844c47
6071 changed files with 777651 additions and 0 deletions
@@ -0,0 +1,33 @@
<template>
<div class="color-select flex flex-1">
<el-color-picker v-model="color" :predefine="predefineColors"></el-color-picker>
<el-input v-model="color" class="mx-[10px] flex-1" type="text" readonly></el-input>
<el-button type="text" @click="reset">重置</el-button>
</div>
</template>
<script setup lang="ts">
import { useVModel } from '@vueuse/core'
const props = defineProps({
modelValue: {
type: String,
default: ''
},
resetColor: {
type: String,
default: ''
}
})
const emit = defineEmits<{
(event: 'update:modelValue', value: number): void
}>()
const color = useVModel(props, 'modelValue', emit)
const predefineColors = ['#FF2C3C', '#f7971e', '#fa444d', '#e0a356', '#2f80ed', '#2ec840']
const reset = () => {
color.value = props.resetColor
}
</script>