diff --git a/components/select/README.md b/components/select/README.md index 3b873109..2cb9e5e9 100644 --- a/components/select/README.md +++ b/components/select/README.md @@ -1,86 +1,72 @@ -## Usage - -```html - - A - B - C - -Selected: {{ selected }} -``` - -```javascript -var vm = new Vue({ - data () { - return { - selected: '', - } - } -}) -``` - -> For better cross-device experiennce, `` will switch from menu to -> native rendering based on the media query -> `(max-width: 600px) and (pointer: coarse)`. - -### mdc-select - -| props | Type | Default | Description | -| ---------- | --------------- | ------- | -------------------------------------------- | -| `disabled` | Boolean | false | whether this select is disabled | -| `label` | String | | the selection label | -| `value` | [String, Array] | | bind with v-model (update on `change` event) | -| `multiple` | Boolean | | whether the select accept multiple values | -| `max-size` | Boolean | 4 | multi select max size | -| `native` | String | | force native select rendering | -| `name` | String | | native select name | - -| event | Description | -| -------- | ----------------------- | -| `@focus` | emitted on focus gained | -| `@blur` | emitted on focus lost | - -### mdc-option - -| props | Type | Default | Description | -| ---------- | ------- | ------- | ------------------------------- | -| `disabled` | Boolean | false | whether this option is disabled | -| `value` | String | | option value | - -> If no option value is specified, the select component will take the option's textContent. - -```html - - A - B - C - -``` - -### Multiple select - -```html - - A - B - C - -Selected: {{ selected }} -``` - -```javascript -var vm = new Vue({ - data () { - return { - selected: [], - } - } -}) -``` - -> multi-select are always rendered natively. the size is reactive and is caped -> by the max-size property - -### Reference - -- +## Usage + +```html + + A + B + C + +Selected: {{ selected }} +``` + +```javascript +var vm = new Vue({ + data() { + return { + selected: '', + }; + }, +}); +``` + +> For better cross-device experiennce, `` will switch from menu to +> native rendering based on the media query +> `(max-width: 600px) and (pointer: coarse)`. + +### mdc-select + +| props | Type | Default | Description | +| ---------- | --------------- | ------- | -------------------------------------------- | +| `disabled` | Boolean | false | whether this select is disabled | +| `label` | String | | the selection label | +| `value` | [String, Array] | | bind with v-model (update on `change` event) | +| `max-size` | Boolean | 4 | multi select max size | +| `name` | String | | native select name | + +| event | Description | +| -------- | ----------------------- | +| `@focus` | emitted on focus gained | +| `@blur` | emitted on focus lost | + +### mdc-option + +| props | Type | Default | Description | +| ---------- | ------- | ------- | ------------------------------- | +| `disabled` | Boolean | false | whether this option is disabled | +| `value` | String | | option value | + +> If no option value is specified, the select component will take the option's textContent. + +### mdc-optgroup + +| props | Type | Default | Description | +| ---------- | ------- | ------- | ------------------------------- | +| `disabled` | Boolean | false | whether this option is disabled | +| `label` | String | | optgroup label | + +```html + + + Steak + Hamburger + + + Beet + Carrot + + +``` + +### Reference + +* diff --git a/components/select/demo.vue b/components/select/demo.vue index 1bf4b1bc..d0f81eb7 100644 --- a/components/select/demo.vue +++ b/components/select/demo.vue @@ -1,56 +1,42 @@ -