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,6 +25,7 @@ | ||
| 25 | @blur="blur" | 25 | @blur="blur" |
| 26 | @keydown.stop="keyDown" | 26 | @keydown.stop="keyDown" |
| 27 | @change="change" | 27 | @change="change" |
| 28 | + :readonly="readonly" | ||
| 28 | :name="name" | 29 | :name="name" |
| 29 | :value="precisionValue"> | 30 | :value="precisionValue"> |
| 30 | </div> | 31 | </div> |
| @@ -97,6 +98,10 @@ | @@ -97,6 +98,10 @@ | ||
| 97 | type: Boolean, | 98 | type: Boolean, |
| 98 | default: false | 99 | default: false |
| 99 | }, | 100 | }, |
| 101 | + readonly: { | ||
| 102 | + type: Boolean, | ||
| 103 | + default: false | ||
| 104 | + }, | ||
| 100 | name: { | 105 | name: { |
| 101 | type: String | 106 | type: String |
| 102 | }, | 107 | }, |
| @@ -183,7 +188,7 @@ | @@ -183,7 +188,7 @@ | ||
| 183 | this.changeStep('down', e); | 188 | this.changeStep('down', e); |
| 184 | }, | 189 | }, |
| 185 | changeStep (type, e) { | 190 | changeStep (type, e) { |
| 186 | - if (this.disabled) { | 191 | + if (this.disabled || this.readonly) { |
| 187 | return false; | 192 | return false; |
| 188 | } | 193 | } |
| 189 | 194 |