-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
47 lines (36 loc) · 928 Bytes
/
index.js
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
40
41
42
43
44
45
46
import { LitElement, html,property,customElement,css } from 'lit-element';
class SimpleGreeting extends LitElement {
static get properties() {
return { name: { type: String } };
}
constructor() {
super();
this.name = 'Mundo';
}
render() {
return html`<p>Hola, ${this.name}!</p>`;
}
}
@customElement('my-element')
export class MyElement extends LitElement {
/**
* Create an observed property. Triggers update on change.
*/
@property()
foo = 'Propiedad ¡¡Hola mundo!!';
/**
* Implement `render` to define a template for your element.
*/
render(){
/**
* Use JavaScript expressions to include property values in
* the element template.
*/
return html` <style>
:host { display: block;
border: 5px solid red;
}
</style><p>${this.foo}</p>`;
}
}
customElements.define('simple-greeting', SimpleGreeting);