Upgrade ui-bool
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is failing Details

This commit is contained in:
philipp lang 2023-09-06 23:40:14 +02:00
parent 71da52791d
commit 560881725d
2 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="bool" v-tooltip="comment" :class="modelValue ? 'enabled' : 'disabled'">
<ui-sprite v-if="!$slots.default" :src="modelValue ? 'check' : 'close'"></ui-sprite>
<div v-tooltip="comment" class="bool" :class="value ? 'enabled' : 'disabled'">
<ui-sprite v-if="!$slots.default" :src="value ? 'check' : 'close'"></ui-sprite>
<slot></slot>
</div>
</template>
@ -8,20 +8,23 @@
<script>
export default {
props: {
modelValue: {},
value: {
type: Boolean,
default: () => false,
},
trueComment: {},
falseComment: {},
},
computed: {
t() {
return this.modelValue ? 'Ja' : 'Nein';
return this.value ? 'Ja' : 'Nein';
},
comment() {
if (this.modelValue && this.trueComment) {
if (this.value && this.trueComment) {
return this.trueComment;
}
if (!this.modelValue && this.falseComment) {
if (!this.value && this.falseComment) {
return this.falseComment;
}

View File

@ -1,7 +1,7 @@
<template>
<div class="bool-row">
<ui-bool true-comment="In NaMi eingetragen" false-comment="Nicht in NaMi eingetragen" v-model="member.has_nami">N</ui-bool>
<ui-bool true-comment="Mittendrin abonniert" false-comment="Mittendrin nicht abonníert" v-model="member.send_newspaper">M</ui-bool>
<ui-bool true-comment="In NaMi eingetragen" false-comment="Nicht in NaMi eingetragen" :value="member.has_nami">N</ui-bool>
<ui-bool true-comment="Mittendrin abonniert" false-comment="Mittendrin nicht abonníert" :value="member.send_newspaper">M</ui-bool>
</div>
</template>