mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:01:53 +08:00
36 lines
788 B
Plaintext
36 lines
788 B
Plaintext
```ts
|
|
// YourPage.ts
|
|
|
|
import { LitElement, html } from 'lit-element';
|
|
|
|
@customElement('demo-document-screen')
|
|
class DocumentScreen extends LitElement {
|
|
@property({ type: Object })
|
|
data: {
|
|
user: Record<string, unknown>;
|
|
document: Record<string, unknown>;
|
|
subdocuments: Array<Record<string, unknown>>;
|
|
} = {};
|
|
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
render() {
|
|
const { user, document, subdocuments } = this.data;
|
|
return html`
|
|
<demo-page-layout .user=${user}>
|
|
<demo-document-header .document=${document}></demo-document-header>
|
|
<demo-document-list .documents=${subdocuments}></demo-document-list>
|
|
</demo-page-layout>
|
|
`;
|
|
}
|
|
}
|
|
|
|
declare global {
|
|
interface HTMLElementTagNameMap {
|
|
'demo-document-screen': DocumentScreen;
|
|
}
|
|
}
|
|
```
|