0
如何在React中進行以下工作?React輸入佔位符內的html字符
<input type="text" placeholder=" Location" />
我看着dangerouslySetInnerHTML
但不是用於設置的道具,如placeholder
如何在React中進行以下工作?React輸入佔位符內的html字符
<input type="text" placeholder=" Location" />
我看着dangerouslySetInnerHTML
但不是用於設置的道具,如placeholder
您可以使用一個JS字符串轉義序列(我不知道U+f124
是什麼性格讓我取代U+00C2
但它可以是任何代碼點):
<input type="text" placeholder={"\u00C2 Location"} />