From afdc0faf165dbc0c90e45043b4f500a3d53ba20f Mon Sep 17 00:00:00 2001
From: zym2525 <540361168@qq.com>
Date: 星期二, 11 三月 2025 21:02:24 +0800
Subject: [PATCH] fix: some
---
packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue b/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue
index 17a7681..619150e 100644
--- a/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue
+++ b/packages/components/src/components/Dialog/ConfirmDialogInfoItem.vue
@@ -1,20 +1,36 @@
<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',
});
type Props = {
label?: string;
- content?: 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