Commit 7309b43422a065ccb380bb773a6db7a0e5c8ce41
1 parent
9271ce9d
InputNumber add `editable` property.
Showing
3 changed files
with
9 additions
and
5 deletions
Show diff stats
examples/routers/input-number.vue
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | <!--<div @click="changeMax">change max</div>--> |
7 | 7 | <!--<Input-number disabled :max="10" :min="1" :step="1.2" v-model="v2"></Input-number>--> |
8 | 8 | <!--<Input-number :max="10" :min="1" v-model="obj.v"></Input-number>--> |
9 | - <InputNumber :max="10" :min="1" :step="1.2" v-model="value2"></InputNumber> | |
9 | + <InputNumber :editable="false" :max="10" :min="1" :step="1.2" v-model="value2"></InputNumber> | |
10 | 10 | <InputNumber :precision="1" :max="10" :min="1" :step="0.1" v-model="value1"></InputNumber> |
11 | 11 | </div> |
12 | 12 | </template> | ... | ... |
src/components/date-picker/base/time-spinner.vue
... | ... | @@ -182,15 +182,15 @@ |
182 | 182 | watch: { |
183 | 183 | hours (val) { |
184 | 184 | if (!this.compiled) return; |
185 | - this.scroll('hours', this.hoursList.findIndex(obj => obj.text == val)); | |
185 | + this.scroll('hours', this.hoursList.findIndex(obj => obj.text == val)); | |
186 | 186 | }, |
187 | 187 | minutes (val) { |
188 | 188 | if (!this.compiled) return; |
189 | - this.scroll('minutes', this.minutesList.findIndex(obj => obj.text == val)); | |
189 | + this.scroll('minutes', this.minutesList.findIndex(obj => obj.text == val)); | |
190 | 190 | }, |
191 | 191 | seconds (val) { |
192 | 192 | if (!this.compiled) return; |
193 | - this.scroll('seconds', this.secondsList.findIndex(obj => obj.text == val)); | |
193 | + this.scroll('seconds', this.secondsList.findIndex(obj => obj.text == val)); | |
194 | 194 | } |
195 | 195 | }, |
196 | 196 | mounted () { | ... | ... |
src/components/input-number/input-number.vue
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 | @blur="blur" |
26 | 26 | @keydown.stop="keyDown" |
27 | 27 | @change="change" |
28 | - :readonly="readonly" | |
28 | + :readonly="readonly || !editable" | |
29 | 29 | :name="name" |
30 | 30 | :value="precisionValue"> |
31 | 31 | </div> |
... | ... | @@ -102,6 +102,10 @@ |
102 | 102 | type: Boolean, |
103 | 103 | default: false |
104 | 104 | }, |
105 | + editable: { | |
106 | + type: Boolean, | |
107 | + default: true | |
108 | + }, | |
105 | 109 | name: { |
106 | 110 | type: String |
107 | 111 | }, | ... | ... |