antd TextArea placeholder文案换行的几种方式

const App = () => {
  const value = `例子:\n今天天气不错`;
  const value1 = `例子:\r今天天气不错`;

  return (
    <>
      <TextArea
        placeholder="例子:&#13;&#10;今天天气不错"
        style={{ height: 80 }}
      />
      <br />
      <TextArea placeholder={value} style={{ height: 80 }} />
      <br />
      <TextArea placeholder={value1} style={{ height: 80 }} />
    </>
  );
};

demo:https://codesandbox.io/s/gua-ying-wen-ben-gao-du-de-wen-ben-yu-antd-4-22-4-forked-t2qk0v?file=/demo.js:138-853

posted @ 2022-11-17 17:24  小菜菜爱吃菜  阅读(678)  评论(0编辑  收藏  举报