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

Commit

Permalink
feat(line-ripple): Synchronise with mdc-web v0.30.0 (add line-ripple …
Browse files Browse the repository at this point in the history
…component)
  • Loading branch information
matsp committed Feb 7, 2018
1 parent 629df48 commit bdd1f39
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions components/LineRipple/LineRipple.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<div
class="mdc-line-ripple"
:class="classes"/>
</template>

<script>
import { MDCLineRipple } from '@material/line-ripple'
export default {
data () {
return {
mdcLineRipple: null
}
},
mounted () {
this.mdcLineRipple = MDCLineRipple.attachTo(this.$el)
},
methods: {
activate () {
this.mdcLineRipple.activate()
},
deactivate () {
this.mdcLineRipple.deactivate()
},
setRippleCenter (xCoordinate) {
this.mdcLineRipple.setRippleCenter(xCoordinate)
}
}
}
</script>

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

### Markup

```html
<m-line-ripple ref="rp"/>
```

### Script

```javascript
this.$refs.rp.activate()
```

### Methods

| Method | Description |
|--------|-------------|
| activate() | activate the line ripple |
| deactivate() | deactivate the line ripple |
| setRippleCenter(xCoordinate) | set ripple center by x-coordinate |


### Reference

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

export default {
install (vm) {
vm.component('m-line-ripple', LineRipple)
}
}
2 changes: 2 additions & 0 deletions components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Icon from './Icon'
import IconToggle from './IconToggle'
import LayoutGrid from './LayoutGrid'
import LinearProgress from './LinearProgress'
import LineRipple from './LineRipple'
import List from './List'
import Menu from './Menu'
import Radio from './Radio'
Expand Down Expand Up @@ -39,6 +40,7 @@ const plugin = {
vue.use(IconToggle)
vue.use(LayoutGrid)
vue.use(LinearProgress)
vue.use(LineRipple)
vue.use(List)
vue.use(Menu)
vue.use(Radio)
Expand Down

0 comments on commit bdd1f39

Please sign in to comment.