fix: Fix color picker type errors (#9436)

This commit is contained in:
Mutasem Aldmour 2024-05-17 11:25:13 +02:00 committed by GitHub
parent bc05faf0a6
commit 2967df2fe0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 13 deletions

View file

@ -40,16 +40,6 @@ const emit = defineEmits<{
(event: 'active-change', value: string): void;
}>();
const model = computed({
get() {
return color.value;
},
set(value: string) {
color.value = value;
emit('update:modelValue', value);
},
});
const onChange = (value: string) => {
emit('change', value);
};
@ -61,15 +51,20 @@ const onInput = (value: string) => {
const onActiveChange = (value: string) => {
emit('active-change', value);
};
const onColorSelect = (value: string) => {
emit('update:modelValue', value);
};
</script>
<template>
<span :class="['n8n-color-picker', $style.component]">
<ElColorPicker
v-model="model"
v-bind="colorPickerProps"
size="default"
@change="onChange"
@active-change="onActiveChange"
@update:model-value="onColorSelect"
/>
<N8nInput
v-if="showInput"

View file

@ -10,7 +10,7 @@ exports[`components > N8nColorPicker > should render with input 1`] = `
<div
aria-description="current color is . press enter to select a new color."
aria-label="color picker"
class="el-color-picker el-color-picker--medium el-tooltip__trigger el-tooltip__trigger"
class="el-color-picker el-color-picker--default el-tooltip__trigger el-tooltip__trigger"
role="button"
tabindex="0"
>
@ -108,7 +108,7 @@ exports[`components > N8nColorPicker > should render without input 1`] = `
<div
aria-description="current color is . press enter to select a new color."
aria-label="color picker"
class="el-color-picker el-color-picker--medium el-tooltip__trigger el-tooltip__trigger"
class="el-color-picker el-color-picker--default el-tooltip__trigger el-tooltip__trigger"
role="button"
tabindex="0"
>