Skip to content

Instantly share code, notes, and snippets.

@Lelectrolux
Last active November 23, 2019 23:16
Show Gist options
  • Save Lelectrolux/78dca8711bd3f0b97b8fe639b94f7365 to your computer and use it in GitHub Desktop.
Save Lelectrolux/78dca8711bd3f0b97b8fe639b94f7365 to your computer and use it in GitHub Desktop.
<script>
export default {
render() {
return this.$scopedSlots.default({
update: this.update,
data: this.$data.data
})
},
props: ['initialData', 'created', 'mounted'],
data() {
return {
data: this.$props.initialData
}
},
methods: {
update(data) {
this.$data.data = Object.assign({}, this.$data.data, data)
}
},
created() {
this.$props.created()
},
mounted() {
this.$props.mounted()
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment