| 116 | interface XFirth extends WebCell<XFirthProps> {} |
| 117 | |
| 118 | @component({ tagName: 'x-firth' }) |
| 119 | @observer |
| 120 | class XFirth extends HTMLElement implements WebCell<XFirthProps> { |
| 121 | @observable |
| 122 | accessor name: string | undefined; |
| 123 | |
| 124 | @on('click', 'h2') |
| 125 | handleClick( |
| 126 | { type, detail }: CustomEvent<number>, |
| 127 | { tagName }: HTMLHeadingElement |
| 128 | ) { |
| 129 | this.name = [type, tagName, detail] + ''; |
| 130 | } |
| 131 | |
| 132 | render() { |
| 133 | return ( |
| 134 | <h2> |
| 135 | <a>{this.name}</a> |
| 136 | </h2> |
| 137 | ); |
| 138 | } |
| 139 | } |
| 140 | renderer.render(<XFirth />); |
| 141 | |
| 142 | const tag = document.body.lastElementChild as XFirth; |