2022-04-04 11:22:00 +05:30
|
|
|
<script>
|
|
|
|
import { __ } from '~/locale';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Usage:
|
|
|
|
*
|
|
|
|
* With a `value` prop:
|
|
|
|
*
|
|
|
|
* <runner-detail label="Field Name" :value="value" />
|
|
|
|
*
|
|
|
|
* Or a `value` slot:
|
|
|
|
*
|
|
|
|
* <runner-detail label="Field Name">
|
|
|
|
* <template #value>
|
|
|
|
* <strong>{{ value }}</strong>
|
|
|
|
* </template>
|
|
|
|
* </runner-detail>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
label: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
value: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
emptyValue: {
|
|
|
|
type: String,
|
|
|
|
default: __('None'),
|
|
|
|
required: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-08-27 11:52:29 +05:30
|
|
|
<div class="gl-display-contents">
|
|
|
|
<dt class="gl-mb-5 gl-mr-6 gl-max-w-26">{{ label }}</dt>
|
|
|
|
<dd class="gl-mb-5">
|
|
|
|
<template v-if="value || $scopedSlots.value">
|
2022-04-04 11:22:00 +05:30
|
|
|
<slot name="value">{{ value }}</slot>
|
|
|
|
</template>
|
|
|
|
<span v-else class="gl-text-gray-500">{{ emptyValue }}</span>
|
|
|
|
</dd>
|
|
|
|
</div>
|
|
|
|
</template>
|