From 02bf8fab66f928b58531e51f72288e9e5f15657b Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Mon, 9 Oct 2017 10:48:48 +0800 Subject: [PATCH] simplify --- src/components/form/form-item.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/form/form-item.vue b/src/components/form/form-item.vue index 654f536..17fb988 100644 --- a/src/components/form/form-item.vue +++ b/src/components/form/form-item.vue @@ -85,13 +85,8 @@ }, watch: { error (val) { - if (val === '') { - this.validateMessage = ''; - this.validateState = ''; - } else { - this.validateMessage = val; - this.validateState = 'error'; - } + this.validateMessage = val; + this.validateState = val === '' ? '' : 'error'; }, validateStatus (val) { this.validateState = val; -- libgit2 0.21.4