forked from verdnatura/salix-front
refs #6075 VnLabelValue created
This commit is contained in:
parent
2b08924a61
commit
0d67ac4450
|
@ -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>
|
Loading…
Reference in New Issue