Upgrade ui-bool
This commit is contained in:
parent
71da52791d
commit
560881725d
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="bool" v-tooltip="comment" :class="modelValue ? 'enabled' : 'disabled'">
|
<div v-tooltip="comment" class="bool" :class="value ? 'enabled' : 'disabled'">
|
||||||
<ui-sprite v-if="!$slots.default" :src="modelValue ? 'check' : 'close'"></ui-sprite>
|
<ui-sprite v-if="!$slots.default" :src="value ? 'check' : 'close'"></ui-sprite>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -8,20 +8,23 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: {},
|
value: {
|
||||||
|
type: Boolean,
|
||||||
|
default: () => false,
|
||||||
|
},
|
||||||
trueComment: {},
|
trueComment: {},
|
||||||
falseComment: {},
|
falseComment: {},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
t() {
|
t() {
|
||||||
return this.modelValue ? 'Ja' : 'Nein';
|
return this.value ? 'Ja' : 'Nein';
|
||||||
},
|
},
|
||||||
comment() {
|
comment() {
|
||||||
if (this.modelValue && this.trueComment) {
|
if (this.value && this.trueComment) {
|
||||||
return this.trueComment;
|
return this.trueComment;
|
||||||
}
|
}
|
||||||
if (!this.modelValue && this.falseComment) {
|
if (!this.value && this.falseComment) {
|
||||||
return this.falseComment;
|
return this.falseComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="bool-row">
|
<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="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" v-model="member.send_newspaper">M</ui-bool>
|
<ui-bool true-comment="Mittendrin abonniert" false-comment="Mittendrin nicht abonníert" :value="member.send_newspaper">M</ui-bool>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue