From 7309b43422a065ccb380bb773a6db7a0e5c8ce41 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Wed, 11 Oct 2017 09:29:16 +0800 Subject: [PATCH] InputNumber add `editable` property. --- examples/routers/input-number.vue | 2 +- src/components/date-picker/base/time-spinner.vue | 6 +++--- src/components/input-number/input-number.vue | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/routers/input-number.vue b/examples/routers/input-number.vue index e14e3d7..db65699 100644 --- a/examples/routers/input-number.vue +++ b/examples/routers/input-number.vue @@ -6,7 +6,7 @@ - + diff --git a/src/components/date-picker/base/time-spinner.vue b/src/components/date-picker/base/time-spinner.vue index 244f709..07fdd8f 100644 --- a/src/components/date-picker/base/time-spinner.vue +++ b/src/components/date-picker/base/time-spinner.vue @@ -182,15 +182,15 @@ watch: { hours (val) { if (!this.compiled) return; - this.scroll('hours', this.hoursList.findIndex(obj => obj.text == val)); + this.scroll('hours', this.hoursList.findIndex(obj => obj.text == val)); }, minutes (val) { if (!this.compiled) return; - this.scroll('minutes', this.minutesList.findIndex(obj => obj.text == val)); + this.scroll('minutes', this.minutesList.findIndex(obj => obj.text == val)); }, seconds (val) { if (!this.compiled) return; - this.scroll('seconds', this.secondsList.findIndex(obj => obj.text == val)); + this.scroll('seconds', this.secondsList.findIndex(obj => obj.text == val)); } }, mounted () { diff --git a/src/components/input-number/input-number.vue b/src/components/input-number/input-number.vue index d11634d..196515f 100644 --- a/src/components/input-number/input-number.vue +++ b/src/components/input-number/input-number.vue @@ -25,7 +25,7 @@ @blur="blur" @keydown.stop="keyDown" @change="change" - :readonly="readonly" + :readonly="readonly || !editable" :name="name" :value="precisionValue"> @@ -102,6 +102,10 @@ type: Boolean, default: false }, + editable: { + type: Boolean, + default: true + }, name: { type: String }, -- libgit2 0.21.4