Created
December 27, 2018 16:01
-
-
Save StefanNieuwenhuis/620a70f92efbcef359c2257d750da868 to your computer and use it in GitHub Desktop.
This file contains 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 } from '@stencil/core'; | |
@Component({ | |
tag: 'my-component', | |
styleUrl: 'my-component.css', | |
shadow: true | |
}) | |
export class MyComponent { | |
@Prop({mutable: true}) isActive = false; | |
public toggleActivity() { | |
this.isActive = !this.isActive; | |
} | |
render() { | |
return <div class={'modal ' + (this.isActive ? 'active' : '')}> | |
<div class="modal__content"> | |
<a href="javascript:;" class="close" onClick={() => this.toggleActivity()}>×</a> | |
<div class="modal__content-body">Lorem ipsum...</div> | |
</div> | |
</div>; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment