From 36c5ea0dac00ca30e36f6cd13d623b299d0be4c5 Mon Sep 17 00:00:00 2001
From: whycq <you@example.com>
Date: 星期五, 23 九月 2022 12:32:27 +0800
Subject: [PATCH] #

---
 components/y-input/y-input.vue |   50 +++++++++++++++++++++++++++-----------------------
 1 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/components/y-input/y-input.vue b/components/y-input/y-input.vue
index c88ac20..1823a00 100644
--- a/components/y-input/y-input.vue
+++ b/components/y-input/y-input.vue
@@ -2,14 +2,16 @@
 	<view>
 		<view class="main">
 			<view style="display: flex;align-items: center;">
-				 <!-- 鏍囬瑁呴グ -->
-				<view class="line"></view>
-				<view class="title" :class="zBig">{{titleText}}</view>
+				<y-title :title="titleText"/>
 			</view>
 			<view :class="zBig">
-				<input type="text" :placeholder="placeholderText" @input="input"
-				 placeholder-style="font-size:22rpx" v-model="val">
-				 <slot />
+				<view style="display: flex;" class="input">
+					<input type="text" :placeholder="placeholderText" @input="input"
+					 placeholder-style="font-size:22rpx" v-model="val">
+					 <view class="icons" v-if="val.length" @click="clear">
+						 <uni-icons type="close"></uni-icons>
+					 </view>
+				</view>
 			</view>
 		</view>
 	</view>
@@ -70,7 +72,11 @@
 		methods: {
 			input() {
 				this.$emit('input',this.val);
+			},
+			clear() {
+				this.val = ''
 			}
+			
 		}
 	}
 </script>
@@ -84,23 +90,18 @@
 		border-radius: 5rpx;
 		box-shadow: 0 0 10upx rgba(0, 0, 0, 0.1);
 	}
-	.line {
-		width: 8rpx;
-		height: 24rpx;
-		border-radius: 5rpx;
+	.input{
+		width: 96%;
+		height: 100%;
 		margin-left: 2%;
-		background-color: #409EFF;
-	}
-	.title {
-		width: 100%;
-		height: 50rpx;
-		line-height: 55rpx;
-		font-size: 32rpx;
-		font-weight: bold;
-		font-family: Arial, Helvetica, sans-serif;
-		text-indent: 3%;
-		letter-spacing: 8rpx;
-		color: #303133;
+		margin-right: 1%;
+		border-radius: 5rpx;
+		color: #606266;
+		/* border: 1px solid #EBEDF0; */
+		background-color: #FAFAFA;
+		font-size: 28rpx;
+		text-indent: 8rpx;
+		/* letter-spacing: 1rpx; */
 	}
 	input{
 		width: 96%;
@@ -111,11 +112,14 @@
 		border-radius: 5rpx;
 		color: #606266;
 		/* border: 1px solid #EBEDF0; */
-		background-color: #FAFAFA;
+		/* background-color: #FAFAFA; */
 		font-size: 28rpx;
 		text-indent: 8rpx;
 		/* letter-spacing: 1rpx; */
 	}
+	.icons {
+		margin-right: 2% ;
+	}
 	.big {
 		height: 80rpx;
 		line-height: 80rpx;

--
Gitblit v1.9.1