Skip to content

Instantly share code, notes, and snippets.

@dillonchanis
Created April 22, 2018 19:24
Show Gist options
  • Save dillonchanis/3883105d0e6fda2ed9c100d4a494b2a3 to your computer and use it in GitHub Desktop.
Save dillonchanis/3883105d0e6fda2ed9c100d4a494b2a3 to your computer and use it in GitHub Desktop.
Simple Error Boundary
export default {
name: 'ErrorBoundary',
data: () => ({
error: false
}),
errorCaptured (err, vm, info) {
this.error = true
},
render (h) {
return this.error ? h('p', 'Something went wrong') : this.$slots.default[0]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment