Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
重置 Vue 组件的数据
/**
* 重置 Vue 组件的数据
* @param {Vue} instance
*/
export function resetVueData(instance: Vue): void {
Object.assign(instance.$data, (instance.$option.data as any).call(instance))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment