Commit 5a12b03a14f94c439f7d786350a57b7a938f1b5c
Committed by
GitHub
Merge pull request #3540 from SergioCrisostomo/add-open-event
Add open change event to color picker
Showing
2 changed files
with
9 additions
and
3 deletions
Show diff stats
examples/routers/color-picker.vue
@@ -12,7 +12,8 @@ | @@ -12,7 +12,8 @@ | ||
12 | <Button @click="setColor">set color</Button> | 12 | <Button @click="setColor">set color</Button> |
13 | 13 | ||
14 | <br><br><br><br> | 14 | <br><br><br><br> |
15 | - <ColorPicker v-model="color7" :hue="false"></ColorPicker> | 15 | + {{openState}} |
16 | + <ColorPicker v-model="color7" :hue="false" @on-open-change="onOpenChange"></ColorPicker> | ||
16 | </div> | 17 | </div> |
17 | </template> | 18 | </template> |
18 | <script> | 19 | <script> |
@@ -22,7 +23,8 @@ | @@ -22,7 +23,8 @@ | ||
22 | return { | 23 | return { |
23 | color: 'rgba(12,34,255,.85)', | 24 | color: 'rgba(12,34,255,.85)', |
24 | color2: '', | 25 | color2: '', |
25 | - color7: '#19be6b' | 26 | + color7: '#19be6b', |
27 | + openState: false, | ||
26 | }; | 28 | }; |
27 | }, | 29 | }, |
28 | computed: {}, | 30 | computed: {}, |
@@ -35,7 +37,10 @@ | @@ -35,7 +37,10 @@ | ||
35 | }, | 37 | }, |
36 | c2 (d) { | 38 | c2 (d) { |
37 | console.log(d); | 39 | console.log(d); |
40 | + }, | ||
41 | + onOpenChange(state){ | ||
42 | + this.openState = state; | ||
38 | } | 43 | } |
39 | } | 44 | } |
40 | }; | 45 | }; |
41 | -</script> | ||
42 | \ No newline at end of file | 46 | \ No newline at end of file |
47 | +</script> |
src/components/color-picker/color-picker.vue