mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
646 B
31 lines
646 B
2 years ago
|
<script lang="ts" setup>
|
||
|
import { Chrome } from '@ckpack/vue-color'
|
||
|
import { computed } from '#imports'
|
||
|
|
||
|
interface Props {
|
||
|
modelValue?: any
|
||
|
mode?: 'hex' | 'hex8' | 'hsl' | 'hsv' | 'rgba'
|
||
|
}
|
||
|
|
||
|
const props = withDefaults(defineProps<Props>(), {
|
||
|
modelValue: () => '#00FFFFFF',
|
||
|
mode: () => 'hex8',
|
||
|
})
|
||
|
|
||
|
const emit = defineEmits(['update:modelValue', 'input'])
|
||
|
|
||
|
const picked = computed({
|
||
|
get: () => props.modelValue || '#00FFFFFF',
|
||
|
set: (val) => {
|
||
|
emit('update:modelValue', val[props.mode] || null)
|
||
|
emit('input', val[props.mode] || null)
|
||
|
},
|
||
|
})
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<Chrome v-model="picked" />
|
||
|
</template>
|
||
|
|
||
|
<style scoped></style>
|