Skip to content

Instantly share code, notes, and snippets.

@LinusBorg
Created Oct 16, 2016
Embed
What would you like to do?
$reset() instance method for Vue
/*
* Add this before you create your Vue instance with new Vue(...)
*/
Vue.prototype.$reset = function () {
var data = this.$options.data()
Object.keys(data).map(key => {
this[key] = data[key]
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment