vuejs reset component
Object.assign(this.$data, this.$options.data())
0
0
export default {
data () {
return {
h2: 0,
// other attributes...
};
},
methods: {
resetFields () {
Object.assign(this.$data, this.$options.data.call(this));
}
}
}
Thank you!
0
0
Are there any code examples left?
New code examples in category Javascript