Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a color with v-if #246

Open
makerovski opened this issue Mar 30, 2022 · 0 comments
Open

Set a color with v-if #246

makerovski opened this issue Mar 30, 2022 · 0 comments

Comments

@makerovski
Copy link

makerovski commented Mar 30, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant