xiaokaike/vue-color

Set a color with v-if

makerovski opened this issue · 0 comments

Hello guys,

Thank you for this awesome feature.

How do I set a default color if some conditions matches, for exemple:

The user can set a background color and, in the next step, can add a text on it. If the user set the background color as black, when the color picker open, the set color for text will be red, if not, white

Is that possible ?

this is my code:

<div class="column is-narrow"> <div>Textfarbe:</div> <div class="font-button" :style="{ background: textObject.fill}" @click="fontColorBoxOpen = true" /> <div v-if="fontColorBoxOpen" class="font-color-box" v-click-outside="closeFontColorBox"> <color-picker :color="defaultColor" @input="updateTextColor" v-model="textObject.fill" /> </div> </div>

I use computed to change the :color="defaultColor" in data, but it does not work

Thanks!