lion/docs/components/dialog/src/slots-dialog-content.js
2022-03-30 12:37:30 +02:00

32 lines
709 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { LitElement, html, css } from '@lion/core';
class SlotsDialogContent extends LitElement {
static get styles() {
return [
css`
:host {
background-color: #fff;
}
.actions {
border-top: 2px solid green;
}
`,
];
}
_closeOverlay() {
this.dispatchEvent(new Event('close-overlay', { bubbles: true }));
}
render() {
return html`
<p>This content contains an actions slot</p>
<div class="actions">
<slot name="actions"></slot>
</div>
<button class="close-button" @click=${this._closeOverlay}></button>
`;
}
}
customElements.define('slots-dialog-content', SlotsDialogContent);