mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix: Fix color picker type errors (#9436)
This commit is contained in:
parent
bc05faf0a6
commit
2967df2fe0
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
>
|
||||
|
|
Loading…
Reference in a new issue