Set togglew color if false
-
My sustomer want the toggle to be green when on (true) but red when off(false)
I tried:
<q-toggle ref="single" size="xl" v-model="itemEdit.single" val="1" :label="$t('posts.single')" :color="itemEdit.single ? 'red' : 'green'" />
This won’t work. Am i’m doing anything wrong or is it not posible?
-
the
color
only controls the ‘when true’ color. I tried something with “keep-color” attribute: -
@dobbel worked like a charm. Thank you so much!