Commit 27d459671e09770981f7aa7da1277162e7a66697
1 parent
0cb1f3e4
#2724 #2672
remove saturation prop, and add hue prop
Showing
2 changed files
with
8 additions
and
4 deletions
Show diff stats
examples/routers/color-picker.vue
| @@ -10,6 +10,9 @@ | @@ -10,6 +10,9 @@ | ||
| 10 | <color-picker v-model="color" placement="bottom-start" size="small"></color-picker> | 10 | <color-picker v-model="color" placement="bottom-start" size="small"></color-picker> |
| 11 | <Date-picker type="date" placeholder="选择日期" size="small" style="width: 200px"></Date-picker> | 11 | <Date-picker type="date" placeholder="选择日期" size="small" style="width: 200px"></Date-picker> |
| 12 | <Button @click="setColor">set color</Button> | 12 | <Button @click="setColor">set color</Button> |
| 13 | + | ||
| 14 | + <br><br><br><br> | ||
| 15 | + <ColorPicker v-model="color7" :saturation="false"></ColorPicker> | ||
| 13 | </div> | 16 | </div> |
| 14 | </template> | 17 | </template> |
| 15 | <script> | 18 | <script> |
| @@ -18,7 +21,8 @@ | @@ -18,7 +21,8 @@ | ||
| 18 | data () { | 21 | data () { |
| 19 | return { | 22 | return { |
| 20 | color: 'rgba(12,34,255,.85)', | 23 | color: 'rgba(12,34,255,.85)', |
| 21 | - color2: '' | 24 | + color2: '', |
| 25 | + color7: '#19be6b' | ||
| 22 | }; | 26 | }; |
| 23 | }, | 27 | }, |
| 24 | computed: {}, | 28 | computed: {}, |
src/components/color-picker/color-picker.vue
| @@ -24,10 +24,10 @@ | @@ -24,10 +24,10 @@ | ||
| 24 | v-transfer-dom> | 24 | v-transfer-dom> |
| 25 | <div :class="[prefixCls + '-picker']"> | 25 | <div :class="[prefixCls + '-picker']"> |
| 26 | <div :class="[prefixCls + '-picker-wrapper']"> | 26 | <div :class="[prefixCls + '-picker-wrapper']"> |
| 27 | - <div v-if="saturation" :class="[prefixCls + '-picker-panel']"> | 27 | + <div :class="[prefixCls + '-picker-panel']"> |
| 28 | <Saturation v-model="saturationColors" @change="childChange"></Saturation> | 28 | <Saturation v-model="saturationColors" @change="childChange"></Saturation> |
| 29 | </div> | 29 | </div> |
| 30 | - <div :class="[prefixCls + '-picker-hue-slider']"> | 30 | + <div v-if="hue" :class="[prefixCls + '-picker-hue-slider']"> |
| 31 | <Hue v-model="saturationColors" @change="childChange"></Hue> | 31 | <Hue v-model="saturationColors" @change="childChange"></Hue> |
| 32 | </div> | 32 | </div> |
| 33 | <div v-if="alpha" :class="[prefixCls + '-picker-alpha-slider']"> | 33 | <div v-if="alpha" :class="[prefixCls + '-picker-alpha-slider']"> |
| @@ -130,7 +130,7 @@ | @@ -130,7 +130,7 @@ | ||
| 130 | value: { | 130 | value: { |
| 131 | type: String | 131 | type: String |
| 132 | }, | 132 | }, |
| 133 | - saturation: { | 133 | + hue: { |
| 134 | type: Boolean, | 134 | type: Boolean, |
| 135 | default: true | 135 | default: true |
| 136 | }, | 136 | }, |