Last active
February 26, 2020 16:35
-
-
Save markgarrigan/498054bbfbc1e90586294b4e5b46fc93 to your computer and use it in GitHub Desktop.
Route nested in child. Riot.js v4
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
<app> | |
<h1>Hello</h1> | |
<router> | |
<ul> | |
<li> | |
<a href="/child">Child</a> | |
</li> | |
</ul> | |
<child something={ doSomething }></child> | |
</router> | |
<script> | |
export default { | |
doSomething(thing) { | |
console.log(thing) | |
this.update() | |
} | |
} | |
</script> | |
<app> |
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
<child> | |
<route path="/child"> | |
<h2>Hello from Child</h2> | |
</route> | |
<script> | |
export default { | |
onMounted(props, state) { | |
props.something('child') | |
} | |
} | |
</script> | |
</child> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment