Selection toolbox color picker button (#2637)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-02-19 15:25:46 -05:00
committed by GitHub
parent 08a6867c00
commit 6c6d86a30b
13 changed files with 299 additions and 8 deletions

View File

@@ -34,15 +34,20 @@ import ColorPicker from 'primevue/colorpicker'
import SelectButton from 'primevue/selectbutton'
import { computed, onMounted, ref, watch } from 'vue'
const { modelValue, colorOptions } = defineProps<{
const {
modelValue,
colorOptions,
allowCustom = true
} = defineProps<{
modelValue: string | null
colorOptions: { name: Exclude<string, '_custom'>; value: string }[]
allowCustom?: boolean
}>()
const customColorOption = { name: '_custom', value: '' }
const colorOptionsWithCustom = computed(() => [
...colorOptions,
customColorOption
...(allowCustom ? [customColorOption] : [])
])
const emit = defineEmits<{