Created
January 27, 2020 21:27
-
-
Save aramvr/e2268d84247296b96cd6383f36e5e406 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