Upgrade ui-bool
This commit is contained in:
parent
71da52791d
commit
560881725d
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue