0
0
Fork 0

refs #6075 VnLabelValue created

This commit is contained in:
Jorge Penadés 2023-07-31 14:09:07 +02:00
parent 2b08924a61
commit 0d67ac4450
1 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,46 @@
<script setup>
import { computed } from 'vue';
const $props = defineProps({
label: { type: String, default: '' },
value: {
type: [String, Boolean],
required: true,
},
info: { type: String, default: '' },
});
const isBooleanValue = computed(() => typeof $props.value === 'boolean');
</script>
<template>
<div class="vn-label-value">
<div class="label">
<slot name="label"></slot>
</div>
<div class="value">
<span v-if="isBooleanValue">
<QIcon :name="value ? `check` : `close`" :class="value ? `positive` : `negative`" />
</span>
<span v-else>
<slot name="value"></slot>
</span>
</div>
<div class="info" v-if="$props.info">
<QIcon name="info">
<QTooltip class="bg-dark text-white shadow-4" :offset="[10, 10]" square>
{{ $props.info }}
</QTooltip>
</QIcon>
</div>
</div>
</template>
<style lang="scss" scoped>
@import '../../css/quasar.variables.scss';
.positive {
color: $positive
}
.negative {
color: $negative
}
</style>