Created
April 23, 2018 21:23
-
-
Save julesjanssen/169be8004b44f0a09a9e0d2f33014b25 to your computer and use it in GitHub Desktop.
dl-hello 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, State } from '@stencil/core' | |
@Component({ | |
tag: 'dl-hello', | |
}) | |
export class DlHello { | |
@State() booleanState: boolean = true | |
componentDidLoad() { | |
setInterval(() => { | |
this.booleanState = ! this.booleanState | |
}, 4000) | |
} | |
render() : JSX.Element { | |
if (this.booleanState) { | |
return ( | |
<div class="yes"> | |
<p>lorem yes</p> | |
<slot name="first"></slot> | |
<slot name="second"></slot> | |
</div> | |
) | |
} | |
return ( | |
<div class="no"> | |
<slot name="second"></slot> | |
<slot name="first"></slot> | |
<p>lorem no</p> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment