From c9d98e7e125c4542b86ee0bd16724016c59abed9 Mon Sep 17 00:00:00 2001 From: 刘汉宸 Date: Thu, 23 Apr 2020 19:39:42 +0800 Subject: [PATCH] 调整输入区样式 --- components/cell/index.scss | 8 +++++--- components/input-field/index.vue | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/components/cell/index.scss b/components/cell/index.scss index 57ec5e9..daefefb 100644 --- a/components/cell/index.scss +++ b/components/cell/index.scss @@ -32,10 +32,10 @@ font-size: 42upx; } &__left-icon { - margin-left: $v-gap-sm; + padding-right: 10upx; } &__right-icon { - margin-left: $v-gap-sm; + padding-left: $v-gap-sm; color: $color-disabled; } &__title, &__value { @@ -45,7 +45,9 @@ flex: auto; flex-direction: column; justify-content: center; - min-width: 150upx; + text-wrap: none; + white-space: nowrap; + word-break: break-all; padding-right: 10upx; box-sizing: border-box; } diff --git a/components/input-field/index.vue b/components/input-field/index.vue index 2f20f1a..38831fe 100644 --- a/components/input-field/index.vue +++ b/components/input-field/index.vue @@ -8,6 +8,9 @@ {{ errorMessage }} + + + @@ -32,15 +35,18 @@ export default { required: Boolean, placeholder: String, errorMessage: String, + valueKey: String, }, data: function() { return { model: this.value, }; }, + mounted: function() { + this.$emit('validate', !this.showError, this.valueKey); + }, watch: { value: function(val) { - console.log(val) this.model = val; } }, @@ -58,6 +64,7 @@ export default { onInput: function(value) { this.model = value; this.$emit('input', value); + this.$emit('validate', !this.showError, this.valueKey); } } } @@ -123,13 +130,18 @@ export default { &-placeholder { color: $color-border; } - &-right { - padding-left: $v-gap-sm; + &-left, &-right { text-wrap: none; white-space: nowrap; word-break: break-all; box-sizing: border-box; } + &-left { + padding-right: $v-gap-sm; + } + &-right { + padding-left: $v-gap-sm; + } } } -- libgit2 0.21.0