React Bootstrap - 向按钮添加逻辑
React Bootstrap - Adding logic to a button
我正在尝试向我的项目按钮添加逻辑 - 这是逻辑:
<Button>
<input variant="primary" type="submit" value={editMode ? "Update Recipe" : "Create Recipe" }>
</input>
</Button>
到目前为止,我找不到实现它的方法.. 所以我最终在我的按钮中输入了一个输入 - 这。看起来很奇怪。
有人可以给我一些见解吗?
here is what it looks like
谢谢:)
基于this documentation,要在表单中实现提交按钮,您可以试试这个:
<Button variant="primary" type="submit">
{editMode ? "Update Recipe" : "Create Recipe" }
</Button>
您实际上可以将按钮用作输入,而不是将输入字段放在按钮内。
我正在尝试向我的项目按钮添加逻辑 - 这是逻辑:
<Button>
<input variant="primary" type="submit" value={editMode ? "Update Recipe" : "Create Recipe" }>
</input>
</Button>
到目前为止,我找不到实现它的方法.. 所以我最终在我的按钮中输入了一个输入 - 这。看起来很奇怪。 有人可以给我一些见解吗?
here is what it looks like 谢谢:)
基于this documentation,要在表单中实现提交按钮,您可以试试这个:
<Button variant="primary" type="submit">
{editMode ? "Update Recipe" : "Create Recipe" }
</Button>
您实际上可以将按钮用作输入,而不是将输入字段放在按钮内。