Commit 9271ce9d42316082f3fd5432790cf95200e4839b
Committed by
GitHub
Merge pull request #2058 from SergioCrisostomo/add-readonly
Add readonly prop to input-number
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
src/components/input-number/input-number.vue
... | ... | @@ -25,6 +25,7 @@ |
25 | 25 | @blur="blur" |
26 | 26 | @keydown.stop="keyDown" |
27 | 27 | @change="change" |
28 | + :readonly="readonly" | |
28 | 29 | :name="name" |
29 | 30 | :value="precisionValue"> |
30 | 31 | </div> |
... | ... | @@ -97,6 +98,10 @@ |
97 | 98 | type: Boolean, |
98 | 99 | default: false |
99 | 100 | }, |
101 | + readonly: { | |
102 | + type: Boolean, | |
103 | + default: false | |
104 | + }, | |
100 | 105 | name: { |
101 | 106 | type: String |
102 | 107 | }, |
... | ... | @@ -183,7 +188,7 @@ |
183 | 188 | this.changeStep('down', e); |
184 | 189 | }, |
185 | 190 | changeStep (type, e) { |
186 | - if (this.disabled) { | |
191 | + if (this.disabled || this.readonly) { | |
187 | 192 | return false; |
188 | 193 | } |
189 | 194 | ... | ... |