gpt4 book ai didi

javascript - 使用 React-redux-form 只读输入字段

转载 作者:行者123 更新时间:2023-11-30 20:44:47 24 4
gpt4 key购买 nike

这样创建可写输入字段时遇到问题。

import { Control } from "react-redux-form";
import { FormControl } from "react-bootstrap";

const existingItem = {
name: "John",
city: "Oakland",
};

<Control
component={FormControl}
model=".defaultItem"
componentClass="input"
id="original-item"
value={existingItem.name}
/>

我的目标是显示一个包含 existingItem.name 的输入字段,以便我可以编辑和提交。

然而,使用 value 属性输入字段变为只读。通常我为此使用 defaultValue 但在这种情况下 defaultValue 呈现输入字段可写但为空。

最佳答案

.defaultItem 很可能在您的商店中不存在。

关于javascript - 使用 React-redux-form 只读输入字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48836098/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com