From a8ff66137ee5397527290dd015d9d9ea39065cf4 Mon Sep 17 00:00:00 2001 From: whycq <you@example.com> Date: 星期五, 23 九月 2022 01:00:34 +0800 Subject: [PATCH] # --- components/y-input/y-input.vue | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/components/y-input/y-input.vue b/components/y-input/y-input.vue index 509986e..7473874 100644 --- a/components/y-input/y-input.vue +++ b/components/y-input/y-input.vue @@ -3,7 +3,7 @@ <view class="main"> <view class="title item-height">{{titleText}}</view> <view class="input item-height"> - <input type="text" :placeholder="placeholderText" @input="input(val)" + <input type="text" :placeholder="placeholderText" @input="input" placeholder-style="font-size:28rpx" v-model="val"> </view> </view> @@ -21,7 +21,16 @@ value: { type: [String, Number], default: '' + }, + placeholder: { + type: String, + default: '' } + }, + watch: { + value(val) { + this.val = val + }, }, created() { this.val = this.value @@ -43,9 +52,8 @@ }; }, methods: { - input(val) { - this.val = val - this.$emit('input',val); + input() { + this.$emit('input',this.val); } } } @@ -69,18 +77,22 @@ color: #303133; } .input { - font-size: 28rpx; + font-size: 12rpx; color: #606266; } .input input{ width: 96%; + height: 45rpx; + line-height: 50rpx; margin-left: 2%; margin-right: 1%; border-radius: 5rpx; border: 1px solid #EBEDF0; background-color: #FAFAFA; - /* box-shadow: 0 0 10upx rgba(0, 0, 0, 0.2); */ + font-size: 28rpx; + text-indent: 10rpx; + /* letter-spacing: 1rpx; */ } .item-height { height: 50rpx; -- Gitblit v1.9.1