zhengyiming
2025-03-13 6f958b20feba65775c8005128fff79563f795898
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<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>