Created
September 27, 2019 16:52
-
-
Save vdegenne/17ae2bc06c53bfed4a01b3c937a65439 to your computer and use it in GitHub Desktop.
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
import { LitElement, html } from 'lit-element' | |
import '@material/mwc-dialog' | |
import '@material/mwc-button' | |
class OurApp extends LitElement { | |
render() { | |
return html` | |
<mwc-dialog title="Are you sure ?" open @closed=${this.onDialogClose}> | |
<div>are you sure to perform this action ?</div> | |
<mwc-button slot=secondaryAction dialogAction=no></mwc-button> | |
<mwc-button slot=primaryAction dialogAction=yes raised></mwc-button> | |
</mwc-dialog> | |
` | |
} | |
onDialogClose (e) { | |
if (e.detail.action === 'yes') { | |
alert('BOOM') | |
} | |
else if (e.detail.action === 'no') { | |
alert('nothing happens') | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment