Skip to content

Instantly share code, notes, and snippets.

@aramvr
Created January 27, 2020 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aramvr/e2268d84247296b96cd6383f36e5e406 to your computer and use it in GitHub Desktop.
Save aramvr/e2268d84247296b96cd6383f36e5e406 to your computer and use it in GitHub Desktop.
Stencil.js sample component
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