Commit 263c991ee0e56301fc3108d4cfb98460e4832f73

Authored by Sergio Crisostomo
1 parent ca1b7bfa

Add open change event to color picker

examples/routers/color-picker.vue
... ... @@ -12,7 +12,8 @@
12 12 <Button @click="setColor">set color</Button>
13 13  
14 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 17 </div>
17 18 </template>
18 19 <script>
... ... @@ -22,7 +23,8 @@
22 23 return {
23 24 color: 'rgba(12,34,255,.85)',
24 25 color2: '',
25   - color7: '#19be6b'
  26 + color7: '#19be6b',
  27 + openState: false,
26 28 };
27 29 },
28 30 computed: {},
... ... @@ -35,7 +37,10 @@
35 37 },
36 38 c2 (d) {
37 39 console.log(d);
  40 + },
  41 + onOpenChange(state){
  42 + this.openState = state;
38 43 }
39 44 }
40 45 };
41   -</script>
42 46 \ No newline at end of file
  47 +</script>
... ...
src/components/color-picker/color-picker.vue
... ... @@ -305,6 +305,7 @@
305 305 } else {
306 306 this.$refs.drop.destroy();
307 307 }
  308 + this.$emit('on-open-change', Boolean(val));
308 309 }
309 310 },
310 311 methods: {
... ...