Commit 4f2dc7e32842a9433142d646b573185de94d6a02

Authored by 梁灏
1 parent 31b721aa

fixed #3086

Showing 2 changed files with 13 additions and 47 deletions   Show diff stats
examples/routers/input.vue
1 1 <template>
2   - <div>
3   - <Input v-model="value11" size="small">
4   - <span slot="prepend">http://</span>
5   - <span slot="append">.com</span>
6   - </Input>
7   - <br>
8   - <Input v-model="value12" size="small">
9   - <Select v-model="select1" slot="prepend" style="width: 80px">
10   - <Option value="http">http://</Option>
11   - <Option value="https">https://</Option>
12   - </Select>
13   - <Select v-model="select2" slot="append" style="width: 70px">
14   - <Option value="com">.com</Option>
15   - <Option value="org">.org</Option>
16   - <Option value="io">.io</Option>
17   - </Select>
18   - </Input>
19   - <br>
20   - <Input v-model="value13" size="small">
21   - <Select v-model="select3" slot="prepend" style="width: 80px">
22   - <Option value="day">Day</Option>
23   - <Option value="month">Month</Option>
24   - </Select>
25   - <Button slot="append" icon="ios-search"></Button>
26   - </Input>
27   - <br>
28   - <Input v-model="value13" size="large">
29   - <Select v-model="select3" slot="prepend" style="width: 80px">
30   - <Option value="day">Day</Option>
31   - <Option value="month">Month</Option>
32   - </Select>
33   - <Button slot="append" icon="ios-search"></Button>
34   - </Input>
35   - <br>
36   - <Input v-model="value13" size="default">
37   - <Select v-model="select3" slot="prepend" style="width: 80px">
38   - <Option value="day">Day</Option>
39   - <Option value="month">Month</Option>
40   - </Select>
41   - <Button slot="append" icon="ios-search"></Button>
42   - </Input>
  2 + <div style="width: 200px;margin: 100px;">
  3 + {{ value6 }}
  4 + <Input v-model="value5" type="textarea" placeholder="Enter something..."></Input>
  5 + <Input v-model="value6" type="textarea" :rows="4" placeholder="Enter something..."></Input>
43 6 </div>
44 7 </template>
45 8 <script>
46 9 export default {
47 10 data () {
48 11 return {
49   - value11: '',
50   - value12: '',
51   - value13: '',
52   - select1: 'http',
53   - select2: 'com',
54   - select3: 'day'
  12 + value5: '',
  13 + value6: ''
55 14 }
56 15 }
57 16 }
... ...
src/components/input/input.vue
... ... @@ -35,6 +35,7 @@
35 35 <textarea
36 36 v-else
37 37 :id="elementId"
  38 + :wrap="wrap"
38 39 :autocomplete="autocomplete"
39 40 :spellcheck="spellcheck"
40 41 ref="textarea"
... ... @@ -135,6 +136,12 @@
135 136 },
136 137 elementId: {
137 138 type: String
  139 + },
  140 + wrap: {
  141 + validator (value) {
  142 + return oneOf(value, ['hard', 'soft']);
  143 + },
  144 + default: 'soft'
138 145 }
139 146 },
140 147 data () {
... ...