Skip to content

Commit

Permalink
fix(projects): fix ColorPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Nov 15, 2023
1 parent 892e2d6 commit c735fd3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/materials/src/libs/color-picker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ function initColorPicker() {
instance.value.on('change', handleColorChange);
}
function updateColor(color: string) {
if (!instance.value) return;
instance.value.setColor(color);
}
function updateDisabled(disabled: boolean) {
if (!instance.value) return;
Expand All @@ -84,6 +90,13 @@ function updateDisabled(disabled: boolean) {
}
}
watch(
() => props.color,
value => {
updateColor(value);
}
);
watch(
() => props.disabled,
value => {
Expand Down

0 comments on commit c735fd3

Please sign in to comment.