fields: () => ({
field: {/etc./}
})
是隐式返回对象(文字)的函数。在不使用
()Javascript的情况下,解释器会将解释
{}为函数体的包装,而不是对象。在不使用parens:的情况下
(),该
field: ...语句被视为一条
label语句,并且该函数返回
undefined。等效语法为:
fields: () => { // start of the function body // now we have to define an object // and explicitly use the return keyword return { field: {} }}因此,父母并不在那里清楚。在这里使用箭头函数的隐式返回功能。



