反応| JSXでhtmlタグをレンダリング

マリアJeysingh暗部:

どのように反応するのHTMLタグと一緒に文字列を描画します。私は次の行に10秒でリダイレクトを追加したいが、私は代わりに、[オブジェクトのオブジェクト]を取得しています。

tip={"Please wait!" +<br/ >+"Redirecing in 10 seconds..."}

ここでは、画像の説明を入力します。 DEMO: CodeSandboxリンク

こうした:

よるドク

Tipである必要がありstring、使用\n改行のためと追加whiteSpace: "break-spacesのスタイルにSpin

<Spin tip={"Please wait! \n Redirecing in 10 seconds..."} style={{ whiteSpace: "break-spaces"}}>

ReactDOM.render(
  <antd.Spin tip={"Please wait! \n Redirecing in 10 seconds..."} style={{ whiteSpace: "break-spaces"}}>
    <antd.Alert
      message="Alert message title"
      description="Further details about the context of this alert."
      type="info"
    />
  </antd.Spin>,
  document.getElementById("container")
);
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/antd/4.0.2/antd.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/antd/4.0.2/antd.min.js"></script>
<div id="container"></div>

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=281311&siteId=1