From 14368e8a09c4b5793d0975f85e36a4c1d410ca36 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期五, 16 五月 2025 17:27:24 +0800 Subject: [PATCH] feat: UI --- packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue b/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue index b8c3dda..619150e 100644 --- a/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue +++ b/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue @@ -1,11 +1,16 @@ <template> <div class="confirm-dialog-content-info-item" :class="{ danger }"> - <div class="confirm-dialog-content-info-item-label">{{ label }}</div> + <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', }); @@ -14,7 +19,18 @@ label?: string; content?: string | number; danger?: boolean; + labelWidth?: string | number; }; -const props = withDefaults(defineProps<Props>(), {}); +const props = withDefaults(defineProps<Props>(), { + labelWidth: 'auto', +}); + +const _labelWidth = computed(() => { + if (typeof props.labelWidth === 'string') { + return props.labelWidth; + } + + return Taro.pxTransform(props.labelWidth); +}); </script> -- Gitblit v1.9.1