Skip to content

Commit 1450ea7

Browse files
author
Pablo Henrique
authored
Merge pull request vuematerial#747 from vuematerial/issue-744
Issue 744 - Added readonly attr on mdInput and mdTextarea
2 parents 0aa9df0 + 25f2e28 commit 1450ea7

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

docs/src/pages/components/Input.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
<md-table-cell><code>Number</code></md-table-cell>
101101
<md-table-cell>Sets the maxlength and enable the text counter.</md-table-cell>
102102
</md-table-row>
103+
104+
<md-table-row>
105+
<md-table-cell>readonly</md-table-cell>
106+
<md-table-cell><code>Boolean</code></md-table-cell>
107+
<md-table-cell>Sets the component to read only mode.</md-table-cell>
108+
</md-table-row>
103109
</md-table-body>
104110
</md-table>
105111
</api-table>
@@ -150,6 +156,12 @@
150156
<md-table-cell><code>Number</code></md-table-cell>
151157
<md-table-cell>Sets the maxlength and enable the text counter.</md-table-cell>
152158
</md-table-row>
159+
160+
<md-table-row>
161+
<md-table-cell>readonly</md-table-cell>
162+
<md-table-cell><code>Boolean</code></md-table-cell>
163+
<md-table-cell>Sets the component to read only mode.</md-table-cell>
164+
</md-table-row>
153165
</md-table-body>
154166
</md-table>
155167
</api-table>
@@ -163,6 +175,11 @@
163175
<label>Initial value</label>
164176
<md-input v-model="initialValue"></md-input>
165177
</md-input-container>
178+
179+
<md-input-container>
180+
<label>Initial value (read only)</label>
181+
<md-input v-model="initialValue" readonly></md-input>
182+
</md-input-container>
166183

167184
<md-input-container>
168185
<label>With label</label>

src/components/mdInputContainer/common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export default {
99
required: Boolean,
1010
maxlength: [Number, String],
1111
name: String,
12-
placeholder: String
12+
placeholder: String,
13+
readonly: Boolean
1314
},
1415
data() {
1516
return {

src/components/mdInputContainer/mdInput.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
:required="required"
88
:placeholder="placeholder"
99
:maxlength="maxlength"
10+
:readonly="readonly"
1011
@focus="onFocus"
1112
@blur="onBlur"
1213
@input="onInput"

src/components/mdInputContainer/mdTextarea.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:required="required"
77
:placeholder="placeholder"
88
:maxlength="maxlength"
9+
:readonly="readonly"
910
@focus="onFocus"
1011
@blur="onBlur"
1112
@input="onInput"></textarea>

0 commit comments

Comments
 (0)