Skip to content

Commit c6b687d

Browse files
author
pablohpsilva
committed
better docs
1 parent 034f845 commit c6b687d

File tree

1 file changed

+42
-21
lines changed

1 file changed

+42
-21
lines changed

docs/src/pages/components/Select.vue

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,24 @@
303303
<div class="multiple" slot="demo">
304304
<div class="field-group">
305305
<md-input-container>
306-
<label for="users">Users</label>
306+
<label for="users">Simple multiselect</label>
307+
<md-select name="option" id="option" multiple v-model="items">
308+
<md-option v-for="option in options"
309+
:key="option"
310+
:value="option">
311+
{{ option.name }}
312+
</md-option>
313+
</md-select>
314+
</md-input-container>
315+
</div>
316+
317+
<div>Selected letters: {{ items }}</div>
318+
<br/>
319+
<br/>
320+
321+
<div class="field-group">
322+
<md-input-container>
323+
<label for="users">Multiselect with subheaders</label>
307324
<md-select name="users" id="users" multiple v-model="users">
308325
<md-subheader>Managers</md-subheader>
309326
<md-option value="jim_halpert">Jim Halpert</md-option>
@@ -327,23 +344,25 @@
327344
</div>
328345

329346
<div>Selected users: {{ users }}</div>
330-
331-
<div class="field-group">
332-
<md-input-container>
333-
<label for="users">Users</label>
334-
<md-select name="option" id="option" multiple v-model="items">
335-
<md-option v-for="option in options"
336-
:key="option"
337-
:value="option">
338-
{{ option.name }}
339-
</md-option>
340-
</md-input-container>
341-
</div>
342347

343348
</div>
344349

345350
<div slot="code">
346351
<code-block lang="xml">
352+
&lt;md-input-container&gt;
353+
&lt;label for=&quot;users=&quot;&gt;Simple multiselect&lt;/label&gt;
354+
&lt;md-select name=&quot;option=&quot; id=&quot;option=&quot; multiple v-model=&quot;items=&quot;&gt;
355+
&lt;md-option v-for=&quot;option in options=&quot;
356+
:key=&quot;option=&quot;
357+
:value=&quot;option=&quot;&gt;
358+
{ { option.name } }
359+
&lt;/md-option&gt;
360+
&lt;md-select&gt;
361+
&lt;/md-input-container&gt;
362+
363+
&lt;div&gt;Selected letters: {{ items }}&lt;/div&gt;
364+
365+
347366
&lt;md-input-container&gt;
348367
&lt;label for=&quot;users&quot;&gt;Users&lt;/label&gt;
349368
&lt;md-select name=&quot;users&quot; id=&quot;users&quot; multiple v-model=&quot;users&quot;&gt;
@@ -374,10 +393,15 @@
374393
export default {
375394
data: () => ({
376395
food: '',
377-
users: [
378-
'jim_halpert',
379-
'michael_scott'
380-
]
396+
users: [],
397+
options: [
398+
{ id: 1, name: 'a' },
399+
{ id: 2, name: 'b' },
400+
{ id: 3, name: 'c' },
401+
{ id: 4, name: 'd' },
402+
{ id: 5, name: 'e' }
403+
],
404+
items: []
381405
})
382406
};
383407
</code-block>
@@ -413,10 +437,7 @@
413437
country: '',
414438
font: '',
415439
food: '',
416-
users: [
417-
'jim_halpert',
418-
'michael_scott'
419-
],
440+
users: [],
420441
options: [
421442
{ id: 1, name: 'a' },
422443
{ id: 2, name: 'b' },

0 commit comments

Comments
 (0)