-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoscd-component.ts
39 lines (34 loc) · 1004 Bytes
/
oscd-component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
/**
* @slot something - You can put something here
*
* @fires fake-event - This is just to show off README generation
*
* @cssprop --oscd-component-text-color - Controls the color of foo
*/
@customElement('oscd-component')
export class OscdComponent extends LitElement {
static styles = css`
:host {
display: block;
padding: 25px;
color: var(--oscd-component-text-color, #000);
}
`;
/** The counter's title */
@property({ type: String }) title = 'Hey there';
/** Another description without information content */
@property({ type: Number }) counter = 5;
__increment() {
this.counter += 1;
this.dispatchEvent(new CustomEvent('fake-event', {}));
}
render() {
return html`
<h2>${this.title} Nr. ${this.counter}!</h2>
<slot name="something"></slot>
<button @click=${this.__increment}>increment</button>
`;
}
}