ColorPicker: add active-change event

pull/5841/head
Leopoldthecoder 2017-07-10 11:59:08 +08:00 committed by 杨奕
parent e7647fd75a
commit 3bc4333578
4 changed files with 8 additions and 3 deletions

View File

@ -94,3 +94,4 @@ ColorPicker is a color selector supporting multiple color formats.
| Event Name | Description | Parameters | | Event Name | Description | Parameters |
|---------|--------|---------| |---------|--------|---------|
| change | triggers when input value changes | color value | | change | triggers when input value changes | color value |
| active-change | triggers when the current active color changes | active color value |

View File

@ -94,3 +94,4 @@
| 事件名称 | 说明 | 回调参数 | | 事件名称 | 说明 | 回调参数 |
|---------- |-------- |---------- | |---------- |-------- |---------- |
| change | 当绑定值变化时触发 | 当前值 | | change | 当绑定值变化时触发 | 当前值 |
| active-change | 面板中当前显示的颜色发生改变时触发 | 当前显示的颜色值 |

View File

@ -70,6 +70,9 @@
handler() { handler() {
this.showPanelColor = true; this.showPanelColor = true;
} }
},
displayedColor(val) {
this.$emit('active-change', val);
} }
}, },

View File

@ -40,7 +40,7 @@
props: { props: {
value: { value: {
type: [Boolean, String, Number], type: [Boolean, String, Number],
default: true default: false
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,