Last active
August 29, 2015 14:14
-
-
Save insin/4ce0df7537a567f1eecb to your computer and use it in GitHub Desktop.
Riot.js Boolean Attribute Test Case - http://bl.ocks.org/insin/raw/4ce0df7537a567f1eecb/
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
<boolean-attrs> | |
<p><code>riot.version: {opts.version}</code></p> | |
<p>Try using the toggle button before and after clicking on the checkboxes. Not working in v2.0.5.</p> | |
<p><code>bool: {String(this.bool)}</code></p> | |
<label><input type="checkbox" checked={this.bool}> <code>checked=\{this.bool\}</code></label> | |
<br> | |
<label><input type="checkbox" checked={!this.bool}> <code>checked=\{!this.bool\}</code></label> | |
<br> | |
<button type="button" onclick={toggleBool}>Toggle <code>bool</code></button> | |
this.bool = false | |
toggleBool() { | |
this.bool = !this.bool | |
} | |
</boolean-attrs> |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Riot.js Boolean Attribute Test Case</title> | |
</head> | |
<body> | |
<boolean-attrs></boolean-attrs> | |
<script src="boolean-attrs.tag" type="riot/tag"></script> | |
<script src="https://raw.githubusercontent.com/muut/riotjs/master/riot.js"></script> | |
<script src="https://raw.githubusercontent.com/muut/riotjs/master/compiler.js"></script> | |
<script> | |
riot.mount('boolean-attrs', {version: riot.version}) | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment