<template>
|
<div class="confirm-dialog-content-info-item" :class="{ danger }">
|
<div class="confirm-dialog-content-info-item-label" :style="{ width: _labelWidth }">
|
{{ label }}
|
</div>
|
<div class="confirm-dialog-content-info-item-content">{{ content }}</div>
|
</div>
|
</template>
|
|
<script setup lang="ts">
|
import Taro from '@tarojs/taro';
|
import { computed } from 'vue';
|
|
defineOptions({
|
name: 'ConfirmDialogInfoItem',
|
});
|
|
type Props = {
|
label?: string;
|
content?: string | number;
|
danger?: boolean;
|
labelWidth?: string | number;
|
};
|
|
const props = withDefaults(defineProps<Props>(), {
|
labelWidth: 'auto',
|
});
|
|
const _labelWidth = computed(() => {
|
if (typeof props.labelWidth === 'string') {
|
return props.labelWidth;
|
}
|
|
return Taro.pxTransform(props.labelWidth);
|
});
|
</script>
|