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

Commit dd6a08a

Browse files
committed
feat(chips): Synchronise with mdc-web v0.30.0 (add chip component)
1 parent 825daf0 commit dd6a08a

File tree

6 files changed

+82
-0
lines changed

6 files changed

+82
-0
lines changed

components/Chips/Chip.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<template>
2+
<div class="mdc-chip">
3+
<div class="mdc-chip__text">
4+
<slot />
5+
</div>
6+
</div>
7+
</template>
8+
9+
<script>
10+
import { MDCChip } from '@material/chips'
11+
12+
export default {
13+
data () {
14+
return {
15+
mdcChip: null
16+
}
17+
},
18+
mounted () {
19+
this.mdcChip = MDCChip.attachTo(this.$el)
20+
}
21+
}
22+
</script>
23+
24+
<style lang="scss">
25+
@import "@material/chips/mdc-chips";
26+
</style>

components/Chips/ChipSet.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<template>
2+
<div class="mdc-chip-set" />
3+
</template>
4+
5+
<script>
6+
import { MDCChipSet } from '@material/chips'
7+
8+
export default {
9+
data () {
10+
return {
11+
mdcChipSet: null
12+
}
13+
},
14+
mounted () {
15+
this.mdcChipSet = MDCChipSet.attachTo(this.$el)
16+
}
17+
}
18+
</script>
19+
20+
<style lang="scss">
21+
@import "@material/chips/mdc-chips";
22+
</style>

components/Chips/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## ChipSet
2+
3+
### Markup
4+
5+
```html
6+
<m-chip-set>
7+
<m-chip>Chip content</m-chip>
8+
</m-chip-set>
9+
```
10+
11+
## Chip
12+
13+
### Slots
14+
15+
| Slot | Description |
16+
|------|-------------|
17+
| default | chip content |
18+
19+
### Reference
20+
21+
- https://github.com/material-components/material-components-web/tree/master/packages/mdc-chips

components/Chips/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Chip from './Chip.vue'
2+
import ChipSet from './ChipSet.vue'
3+
4+
export default {
5+
install (vm) {
6+
vm.component('m-chip', Chip)
7+
vm.component('m-chip-set', ChipSet)
8+
}
9+
}

components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Button from './Button'
22
import Card from './Card'
33
import Checkbox from './Checkbox'
4+
import Chips from './Chips'
45
import Dialog from './Dialog'
56
import Elevation from './Elevation'
67
import Fab from './Fab'
@@ -31,6 +32,7 @@ const plugin = {
3132
vue.use(Button)
3233
vue.use(Card)
3334
vue.use(Checkbox)
35+
vue.use(Chips)
3436
vue.use(Dialog)
3537
vue.use(Elevation)
3638
vue.use(Fab)

components/material-components-vue.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
@import "@material/line-ripple/mdc-line-ripple";
12
@import "@material/button/mdc-button";
23
@import "@material/card/mdc-card";
34
@import "@material/checkbox/mdc-checkbox";
5+
@import "@material/chips/mdc-chips";
46
@import "@material/dialog/mdc-dialog";
57
@import "@material/drawer/mdc-drawer";
68
@import "@material/elevation/mdc-elevation";

0 commit comments

Comments
 (0)