Object.
assign赋值后
无法修改问题、深拷贝....
这样能解决
赋值后
无法编辑的问题,
this.form =
Object.
assign({}, this.form, { name: ‘a’ })
而 这样
不能:
Object.
assign(this.form, { name: ‘a’ })
this.form =
Object.
assign({ name: ‘a’ })
转载:http://www.cnblogs.com/zhaowenxin/p/6160676.html
对象的扩展
1.ES6中,对象的属性和方法可简写:对象的属性值可不写,前提是属性名已经声明;
1 var name = "zhangsan";
2 var password = "1111111";
3 var obj = {
4 ...
var oa = new
ObjectAssign ( ) ;
var t = { name : "lisa" , age : 25 } ;
var r = { speak : function ( ) { console . log ( 'H
ello, World!' ) } }
var k = oa .
assign ( r , t ) ;
// k = { name : "lisa", age : 25, speak : function () { console.log('H
ello, World!')} }
<template>
<