Created
January 27, 2020 21:28
-
-
Save aramvr/06d5279fa2f9126d7681b426ec46370d to your computer and use it in GitHub Desktop.
Stencil.js sample component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, Prop, h } from '@stencil/core'; | |
import { format } from '../../utils/utils'; | |
@Component({ | |
tag: 'my-component', | |
styleUrl: 'my-component.css', | |
shadow: true | |
}) | |
export class MyComponent { | |
/** | |
* The first name | |
*/ | |
@Prop() first: string; | |
/** | |
* The middle name | |
*/ | |
@Prop() middle: string; | |
/** | |
* The last name | |
*/ | |
@Prop() last: string; | |
private getText(): string { | |
return format(this.first, this.middle, this.last); | |
} | |
render() { | |
return <div>Hello, World! I'm {this.getText()}</div>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment