From b5184d556fba67ade9e8632d03b8d930f730ccb0 Mon Sep 17 00:00:00 2001 From: 刘汉宸 Date: Thu, 23 Apr 2020 15:30:59 +0800 Subject: [PATCH] 新增输入区组件 --- components/button/index.vue | 11 ++++++++++- components/input-field/index.vue | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ components/input/index.vue | 6 +++--- 3 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 components/input-field/index.vue diff --git a/components/button/index.vue b/components/button/index.vue index 99755b6..7703c99 100644 --- a/components/button/index.vue +++ b/components/button/index.vue @@ -23,13 +23,22 @@ export default { round: Boolean, square: Boolean, disabled: Boolean, + plain: Boolean, }, computed: { style: function() { return `display: ${this.block ? '' : 'inline-block'};` ; }, classRender: function() { - return [this.size, this.disabled ? 'disabled' : '', this.block ? 'block' : '', this.type, this.round ? 'round' : '', this.square ? 'square' : '']; + return [ + this.size, + this.type, + this.disabled ? 'disabled' : '', + this.block ? 'block' : '', + this.round ? 'round' : '', + this.square ? 'square' : '', + this.plain ? 'plain' : '', + ]; } }, methods: { diff --git a/components/input-field/index.vue b/components/input-field/index.vue new file mode 100644 index 0000000..2f20f1a --- /dev/null +++ b/components/input-field/index.vue @@ -0,0 +1,135 @@ + + + + + diff --git a/components/input/index.vue b/components/input/index.vue index 9bd3048..ab96c1a 100644 --- a/components/input/index.vue +++ b/components/input/index.vue @@ -15,7 +15,7 @@ export default { ZuiIcon, }, props: { - value: String, + value: [String, Number], type: { type: String, default: 'text' @@ -43,8 +43,8 @@ export default { this.$emit('input', value); }, onClear: function() { - this.model = undefined; - this.$emit('input', undefined); + this.model = ''; + this.$emit('input', ''); this.$emit('clear'); } } -- libgit2 0.21.0