forked from cypress-io/cypress-example-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.js
More file actions
32 lines (28 loc) · 669 Bytes
/
Copy pathelements.js
File metadata and controls
32 lines (28 loc) · 669 Bytes
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
import { LitElement, html } from 'https://unpkg.com/lit-element/lit-element.js?module'
window.customElements.define('element-one', class extends LitElement {
static get properties () {
return {
_message: {
type: String,
},
}
}
_onClick () {
this._message = 'I am element 1!'
}
render () {
return html`
<p>${this._message || ''}</p>
<button @click=${this._onClick}>Click me</button>
`
}
})
window.customElements.define('element-two', class extends LitElement {
render () {
return html`
<div class="container">
<slot></slot>
</div>
`
}
})