ColorPicker support value null

This commit is contained in:
梁灏 2021-09-15 17:15:36 +08:00
parent c9a33a082c
commit c191f14737

View file

@ -242,8 +242,8 @@ export default {
data() { data() {
return { return {
val: changeColor(this.value), val: changeColor(this.value || ''),
currentValue: this.value, currentValue: this.value || '',
dragging: false, dragging: false,
visible: false, visible: false,
recommendedColor: [ recommendedColor: [
@ -412,7 +412,7 @@ export default {
this.val = changeColor(newVal); this.val = changeColor(newVal);
}, },
visible(val) { visible(val) {
this.val = changeColor(this.value); this.val = changeColor(this.value || '');
this.$refs.drop[val ? 'update' : 'destroy'](); this.$refs.drop[val ? 'update' : 'destroy']();
this.$emit('on-open-change', Boolean(val)); this.$emit('on-open-change', Boolean(val));
}, },