输入字段数据数组不能在REACT中生成所需的选项


export const InputData = [
{
id: "email",
name: "email",
type: "email",
classname: "w-full p-3 text-sm border-2 border-gray-300 focus:border-primary-600 placeholder-gray-500 rounded-md focus:outline-none",
placeholder: "Email",
required: "required"
}
]
...
{InputData.map((item) => {
return <input
id={item.id}
name={item.name}
type={item.type}
className={item.classname}
placeholder={item.placeholder}
required ={item.required}
/>
}
)}

我试图使输入字段的数组,但我不知道如何使数组所需的字段,但给我一个错误,有人可以帮助我吗?

use this:

export const InputData = [{
id: "email",
name: "email",
type: "email",
classname: "w-full p-3 text-sm border-2 border-gray-300 focus:border-primary-600 placeholder-gray-500 rounded-md focus:outline-none",
placeholder: "Email",
required: true
}]

相关内容

  • 没有找到相关文章

最新更新