-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (24 loc) · 693 Bytes
/
index.js
File metadata and controls
27 lines (24 loc) · 693 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
import * as component from 'lib0/component.js'
component.defineListComponent()
component.defineLazyLoadingComponent()
/**
* @example
* <my-blue></my-blue>
*
* @example
* <my-blue><h1 slot="content">my blue headline</h1></my-blue>
*/
export const MyBlueComponent = component.createComponent('my-blue', {
template: '<slot name="content">Hello World</slot>',
style: 'slot[name="content"] { color: blue; };'
})
export const SomeList = component.createComponent('some-list', {
template: '<lib0-list></lib0-list>',
state: { someContent: ['A', 'B', 'C'] },
attrs: {
someContent: 'json'
},
childStates: {
'lib0-list': state => ({ list: state.someContent })
}
})