From c814bf32e899265776cd1e66d611dba02dcaf552 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期一, 25 九月 2023 17:01:45 +0800 Subject: [PATCH] # --- components/z-input/z-input.vue | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/z-input/z-input.vue b/components/z-input/z-input.vue index 2d1da6c..ab8a105 100644 --- a/components/z-input/z-input.vue +++ b/components/z-input/z-input.vue @@ -4,7 +4,7 @@ <view class="inner1">{{desc}}</view> <view class="put inner2"> <input class="p-input" type="text" :placeholder="placeholder" @input="input" v-model="val"> - <uni-icons class="p-icon" type="closeempty" size="16" color="#707070" v-if="val.length" @click="clear"></uni-icons> + <uni-icons class="p-icon" type="closeempty" size="16" color="#707070" v-show="val.length" @click="clear"></uni-icons> </view> <view class="inner3" v-show="btn"> <button class="m-btn" size="mini">{{btnName}}</button> @@ -34,13 +34,17 @@ default: '璇疯緭鍏�' }, value: { - type: [String, Number], + type: String, default: '' + }, + lenCheck: { + type: [Number], + default: null }, }, watch: { value(val) { - console.log(val); + console.log(1); this.val = val }, }, @@ -54,6 +58,10 @@ }, methods: { input() { + console.log(3); + if(this.val.length != this.lenCheck) { + this.val = '' + } this.$emit('input',this.val); }, clear() { -- Gitblit v1.9.1