mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 10:20:42 +01:00
feat(ColorPicker): implement component (#2670)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -29,6 +29,7 @@ const components = [
|
||||
'checkbox',
|
||||
'chip',
|
||||
'collapsible',
|
||||
'color-picker',
|
||||
'context-menu',
|
||||
'command-palette',
|
||||
'drawer',
|
||||
|
||||
26
playground/app/pages/components/color-picker.vue
Normal file
26
playground/app/pages/components/color-picker.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
const colorHex = ref('#9C27B0')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-5">
|
||||
<div class="flex items-center gap-2">
|
||||
<span :style="{ backgroundColor: colorHex }" class="inline-flex w-5 h-5 rounded" />
|
||||
<code class="font-mono">{{ colorHex }}</code>
|
||||
</div>
|
||||
<USeparator />
|
||||
<div class="flex justify-between gap-2">
|
||||
<UButton @click="colorHex = '#9C27B0'">
|
||||
Purple
|
||||
</UButton>
|
||||
<UButton @click="colorHex = '#8BC34A'">
|
||||
Lime
|
||||
</UButton>
|
||||
<UButton @click="colorHex = '#FF6347'">
|
||||
Tomato
|
||||
</UButton>
|
||||
</div>
|
||||
<USeparator />
|
||||
<UColorPicker v-model="colorHex" @update:model-value="() => console.log('model update')" />
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user