我正在研究 React JS。我试图在这里使用传播运算符。下面是我的代码。
const parametersQuickStoreSearch = (searchTerms, options, store) => {
}
在上面的代码中,searchTerms 的值为 is simsKeycode:"35431081"
,store 的值为{value:all,label:all}
。我想结合 searchTerms 和 store 的值,如下所示。
{ simsKeycode:"35431081", store: store.value }
我试过如下
const storeParam = {
'store': store.value,
}
这行抛出我的错误Unnecessarily quoted property 'store' found
有人可以帮我完成这个吗?任何帮助,将不胜感激。
以下是示例:
const person = { name: 'David Walsh', gender: 'Male' };
const tools = { computer: 'Mac', editor: 'Atom' };
const summary = {...person, ...tools};
/*
Object {
"computer": "Mac",
"editor": "Atom",
"gender": "Male",
"name": "David Walsh",
}
*/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句