Skip to content

Instantly share code, notes, and snippets.

@darrenjennings
Last active January 12, 2018 00:57
Show Gist options
  • Save darrenjennings/2a726fce150831acbe2a8d1d6d2bf3d5 to your computer and use it in GitHub Desktop.
Save darrenjennings/2a726fce150831acbe2a8d1d6d2bf3d5 to your computer and use it in GitHub Desktop.
Vue Render Prop - Parent
<template>
<div id="app">
<Mouse :render="__render"/>
</div>
</template>
<script>
import Mouse from "./Mouse.js";
export default {
name: "app",
components: {
Mouse
},
methods: {
__render({ x, y }) {
return (
<h1>
The mouse position is ({x}, {y})
</h1>
);
}
}
};
</script>
<style>
* {
margin: 0;
height: 100%;
width: 100%;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment