-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor dispatch event mixin to support underlying html and material-components-web events as well as global event bus
- Loading branch information
Showing
18 changed files
with
479 additions
and
1,408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<template> | ||
<custom-button ref="root" | ||
:class="classes" :style="styles" | ||
:href="href" :link="link" :disabled="disabled" | ||
@click="dispatchEvent"> | ||
:class="classes" :style="styles" | ||
:href="href" :link="link" :disabled="disabled" | ||
v-on="listeners"> | ||
<slot /> | ||
</custom-button> | ||
</template> | ||
|
||
<script> | ||
import {DispatchEventMixin, CustomButtonMixin} from '../base' | ||
import {RippleMixin} from '../ripple' | ||
import { DispatchEventMixin, CustomButtonMixin } from '../base'; | ||
import { RippleMixin } from '../ripple'; | ||
export default { | ||
name: 'mdc-button-base', | ||
mixins: [DispatchEventMixin, CustomButtonMixin, RippleMixin], | ||
data () { | ||
data() { | ||
return { | ||
classes: {}, | ||
styles: {} | ||
} | ||
} | ||
} | ||
styles: {}, | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
<template> | ||
<span :class="classes" :style="styles" | ||
@click="dispatchEvent"> | ||
v-on="listeners"> | ||
<slot>{{ icon }}</slot> | ||
</span> | ||
</template> | ||
|
||
<script> | ||
import {DispatchEventMixin} from '../base' | ||
import {RippleBase} from '../ripple' | ||
import { DispatchEventMixin } from '../base'; | ||
import { RippleBase } from '../ripple'; | ||
export default { | ||
name: 'mdc-card-action-icon', | ||
mixins: [DispatchEventMixin], | ||
props: { | ||
icon: String | ||
icon: String, | ||
}, | ||
data () { | ||
data() { | ||
return { | ||
classes: { | ||
'mdc-card-action-icon': true, | ||
'material-icons':!!this.icon, | ||
'mdc-card-action-icon': true, | ||
'material-icons': !!this.icon, | ||
'mdc-card__action': true, | ||
'mdc-card__action--icon': true, | ||
'mdc-icon-toggle': true | ||
'mdc-icon-toggle': true, | ||
}, | ||
styles: {} | ||
} | ||
styles: {}, | ||
}; | ||
}, | ||
watch: { | ||
icon () { | ||
this.$set(this.classes, 'material-icons', !!this.icon) | ||
} | ||
icon() { | ||
this.$set(this.classes, 'material-icons', !!this.icon); | ||
}, | ||
}, | ||
mounted () { | ||
this.ripple = new RippleBase(this,{ | ||
mounted() { | ||
this.ripple = new RippleBase(this, { | ||
isUnbounded: () => true, | ||
}) | ||
this.ripple.init() | ||
}); | ||
this.ripple.init(); | ||
}, | ||
beforeDestroy () { | ||
this.ripple.destroy() | ||
} | ||
} | ||
beforeDestroy() { | ||
this.ripple.destroy(); | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.