mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
add open watcher
This commit is contained in:
@@ -2,7 +2,7 @@ import { LitElement, html, unsafeCSS } from 'lit';
|
||||
import { customElement, property, query, state } from 'lit/decorators';
|
||||
import { classMap } from 'lit-html/directives/class-map';
|
||||
import { ifDefined } from 'lit-html/directives/if-defined';
|
||||
import { event, EventEmitter } from '../../internal/decorators';
|
||||
import { event, EventEmitter, watch } from '../../internal/decorators';
|
||||
import styles from 'sass:./drawer.scss';
|
||||
import { lockBodyScrolling, unlockBodyScrolling } from '../../internal/scroll';
|
||||
import { hasSlot } from '../../internal/slot';
|
||||
@@ -191,6 +191,11 @@ export default class SlDrawer extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
@watch('open')
|
||||
handleOpenChange() {
|
||||
this.open ? this.show() : this.hide();
|
||||
}
|
||||
|
||||
handleOverlayClick() {
|
||||
const slOverlayDismiss = this.slOverlayDismiss.emit();
|
||||
if (!slOverlayDismiss.defaultPrevented) {
|
||||
|
||||
Reference in New Issue
Block a user