icssoa 7 ヶ月 前
コミット
bfef717557
1 ファイル変更12 行追加10 行削除
  1. 12 10
      uni_modules/cool-ui/components/cl-form-item/cl-form-item.uvue

+ 12 - 10
uni_modules/cool-ui/components/cl-form-item/cl-form-item.uvue

@@ -27,16 +27,18 @@
 			</view>
 		</view>
 
-		<slot name="error" :error="errorText" v-if="hasError && showMessage">
-			<cl-text
-				color="error"
-				:pt="{
-					className: parseClass(['mt-2 !text-sm', pt.error?.className])
-				}"
-			>
-				{{ errorText }}
-			</cl-text>
-		</slot>
+		<template v-if="hasError && showMessage">
+			<slot name="error" :error="errorText">
+				<cl-text
+					color="error"
+					:pt="{
+						className: parseClass(['mt-2 !text-sm', pt.error?.className])
+					}"
+				>
+					{{ errorText }}
+				</cl-text>
+			</slot>
+		</template>
 	</view>
 </template>