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

Commit

Permalink
feat(chips): Synchronise with mdc-web v0.30.0 (add chip component)
Browse files Browse the repository at this point in the history
  • Loading branch information
matsp committed Feb 7, 2018
1 parent 825daf0 commit dd6a08a
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 0 deletions.
26 changes: 26 additions & 0 deletions components/Chips/Chip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div class="mdc-chip">
<div class="mdc-chip__text">
<slot />
</div>
</div>
</template>

<script>
import { MDCChip } from '@material/chips'
export default {
data () {
return {
mdcChip: null
}
},
mounted () {
this.mdcChip = MDCChip.attachTo(this.$el)
}
}
</script>

<style lang="scss">
@import "@material/chips/mdc-chips";
</style>
22 changes: 22 additions & 0 deletions components/Chips/ChipSet.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<div class="mdc-chip-set" />
</template>

<script>
import { MDCChipSet } from '@material/chips'
export default {
data () {
return {
mdcChipSet: null
}
},
mounted () {
this.mdcChipSet = MDCChipSet.attachTo(this.$el)
}
}
</script>

<style lang="scss">
@import "@material/chips/mdc-chips";
</style>
21 changes: 21 additions & 0 deletions components/Chips/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## ChipSet

### Markup

```html
<m-chip-set>
<m-chip>Chip content</m-chip>
</m-chip-set>
```

## Chip

### Slots

| Slot | Description |
|------|-------------|
| default | chip content |

### Reference

- https://github.com/material-components/material-components-web/tree/master/packages/mdc-chips
9 changes: 9 additions & 0 deletions components/Chips/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Chip from './Chip.vue'
import ChipSet from './ChipSet.vue'

export default {
install (vm) {
vm.component('m-chip', Chip)
vm.component('m-chip-set', ChipSet)
}
}
2 changes: 2 additions & 0 deletions components/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Button from './Button'
import Card from './Card'
import Checkbox from './Checkbox'
import Chips from './Chips'
import Dialog from './Dialog'
import Elevation from './Elevation'
import Fab from './Fab'
Expand Down Expand Up @@ -31,6 +32,7 @@ const plugin = {
vue.use(Button)
vue.use(Card)
vue.use(Checkbox)
vue.use(Chips)
vue.use(Dialog)
vue.use(Elevation)
vue.use(Fab)
Expand Down
2 changes: 2 additions & 0 deletions components/material-components-vue.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import "@material/line-ripple/mdc-line-ripple";
@import "@material/button/mdc-button";
@import "@material/card/mdc-card";
@import "@material/checkbox/mdc-checkbox";
@import "@material/chips/mdc-chips";
@import "@material/dialog/mdc-dialog";
@import "@material/drawer/mdc-drawer";
@import "@material/elevation/mdc-elevation";
Expand Down

0 comments on commit dd6a08a

Please sign in to comment.