Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
feat(select): Synchronise with mdc-web
Browse files Browse the repository at this point in the history
BREAKING CHANGES: Renamed slot 'bottomLine' to 'line'.
  • Loading branch information
matsp committed Jul 9, 2018
1 parent b2cad7f commit 91bc17f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
29 changes: 21 additions & 8 deletions components/select/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@

```html
<m-select v-model="selected">
<option v-for="option in selectOptions" :key="option.text" :value="option.value" :selected="selected === option.value">
<option
v-for="option in selectOptions"
:key="option.text"
:value="option.value"
:selected="selected === option.value">
{{ option.text }}
</option>
<m-floating-label
slot="label"
:floatAbove="selected !== ''">
Pick a food group
</m-floating-label>
<m-line-ripple slot="bottomLine"/>
</option>
<m-floating-label
slot="label"
:floatAbove="selected !== ''">
Pick a food group
</m-floating-label>
<m-line-ripple slot="line"/>
</m-select>

<m-select outlined>
<option>...</option>
<m-floating-label
slot="label">
Pick a food group
<m-notched-outline slot="line"/>
</m-select>
```

Expand Down Expand Up @@ -45,6 +57,7 @@ data() {
|------|------|---------|-------------|
| disabled | Boolean | false | whether the select should be disabled |
| box | Boolean | false | renders a select box |
| outlined | Boolean | false | outlined select |

### Slots

Expand Down
9 changes: 7 additions & 2 deletions components/select/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<slot/>
</select>
<slot name="label"/>
<slot name="bottomLine"/>
<slot name="line"/>
</div>
</template>

Expand All @@ -38,6 +38,10 @@ export default {
box: {
type: Boolean,
default: false
},
outlined: {
type: Boolean,
default: false
}
},
data () {
Expand All @@ -49,7 +53,8 @@ export default {
classes () {
return {
'mdc-select--box': this.box,
'mdc-select--disabled': this.disabled
'mdc-select--disabled': this.disabled,
'mdc-select--outlined': this.outlined
}
}
},
Expand Down

0 comments on commit 91bc17f

Please sign in to comment.