vue中v-model绑定的变量赋值给了另一个变量后,两个变量同时改变
// 方法一
this.submitForm = JSON.parse(JSON.stringify(this.formData) )
// 方法二(ES6 的解析语法)
this.submitForm = { ...this.formData }
参考:https://blog.csdn.net/weixin_44675256/article/details/90240003
vue中v-model绑定的变量赋值给了另一个变量后,两个变量同时改变
// 方法一
this.submitForm = JSON.parse(JSON.stringify(this.formData) )
// 方法二(ES6 的解析语法)
this.submitForm = { ...this.formData }
参考:https://blog.csdn.net/weixin_44675256/article/details/90240003
本文标题:vue两个变量同时改变
本文链接:https://www.haomeiwen.com/subject/jbpbnctx.html
网友评论