forked from verdnatura/salix-front
refs #6075 fix: add $props.value
This commit is contained in:
parent
c75c404c29
commit
68935f2a4d
|
@ -9,20 +9,21 @@ const $props = defineProps({
|
|||
info: { type: String, default: null },
|
||||
});
|
||||
const isBooleanValue = computed(() => typeof $props.value === 'boolean');
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="vn-label-value">
|
||||
<div v-if="$props.label || $slots.label" class="label">
|
||||
<div v-if="!$slots.label">{{ $props.label }}</div>
|
||||
<slot name="label"></slot>
|
||||
<slot name="label"> {{ $props.label }}</slot>
|
||||
</div>
|
||||
<div v-if="$props.value || $slots.value" class="value">
|
||||
<span v-if="isBooleanValue">
|
||||
<QIcon :name="$props.value ? `check` : `close`" :color="$props.value ? `positive` : `negative`" />
|
||||
<QIcon
|
||||
:name="$props.value ? `check` : `close`"
|
||||
:color="$props.value ? `positive` : `negative`"
|
||||
/>
|
||||
</span>
|
||||
<span v-else>
|
||||
<slot name="value"></slot>
|
||||
<slot name="value">{{ $props.value }}</slot>
|
||||
</span>
|
||||
</div>
|
||||
<div class="info" v-if="$props.info">
|
||||
|
|
Loading…
Reference in New Issue