From d2c57ec06d66b13e3a79cac3ebc1d3dad3679153 Mon Sep 17 00:00:00 2001 From: whycq <you@example.com> Date: 星期五, 23 九月 2022 14:32:49 +0800 Subject: [PATCH] # --- components/y-input-btn/y-input-btn.vue | 39 +++++++++++++++++++++++++++++++-------- 1 files changed, 31 insertions(+), 8 deletions(-) diff --git a/components/y-input-btn/y-input-btn.vue b/components/y-input-btn/y-input-btn.vue index 6bed5de..1538cd6 100644 --- a/components/y-input-btn/y-input-btn.vue +++ b/components/y-input-btn/y-input-btn.vue @@ -2,14 +2,18 @@ <view> <view class="main"> <y-title /> - <!-- <view class="title" :class="zBig">{{titleText}}</view> --> <view class="column" :class="zBig"> - <input type="text" :placeholder="placeholderText" @input="input" - placeholder-style="font-size:22rpx" v-model="val"> - <view class="btn"> - <button class="small-btn" size="mini" type="primary" @click="confrim">{{btnText}}</button> + <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> - <slot /> + </view> + <view class="btn"> + <button class="small-btn" size="mini" type="primary" @click="confrim">{{btnText}}</button> + </view> + <slot /> </view> </view> </view> @@ -67,19 +71,38 @@ }, confrim() { this.$emit('confrim'); + }, + clear() { + this.val = '' + this.input() } } } </script> <style> -.main { + .main { width: 96%; min-height: 100rpx; background-color: #fff; margin: 2%; border-radius: 5rpx; box-shadow: 0 0 10upx rgba(0, 0, 0, 0.1); + } + .input{ + width: 96%; + height: 100%; + margin-left: 2%; + margin-right: 1%; + border-radius: 5rpx; + color: #606266; + background-color: #FAFAFA; + font-size: 28rpx; + text-indent: 8rpx; + /* letter-spacing: 1rpx; */ + } + .icons { + margin-right: 2% ; } .title { height: 50rpx; @@ -96,7 +119,7 @@ } input{ display: flex; - width: 70%; + width: 96%; height: 45rpx; line-height: 50rpx; margin-left: 2%; -- Gitblit v1.9.1