ant-design/components/form/demo/label-debug.md
2022-05-23 14:37:16 +08:00

948 B

order title debug
100
zh-CN en-US
测试 label 省略 label ellipsis
true

zh-CN

label 中使用 <Typography.Text ellipsis> 时应该显示 ...

en-US

Use <Typography.Text ellipsis> in label should show ....

import { Form, Input, Typography } from 'antd';
import React from 'react';

const App: React.FC = () => (
  <Form name="label-ellipsis" labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
    <Form.Item
      label={
        <Typography.Text ellipsis>
          longtextlongtextlongtextlongtextlongtextlongtextlongtext
        </Typography.Text>
      }
      name="username"
    >
      <Input />
    </Form.Item>

    <Form.Item
      label={
        <Typography.Text ellipsis>
          longtext longtext longtext longtext longtext longtext longtext
        </Typography.Text>
      }
      name="password"
    >
      <Input.Password />
    </Form.Item>
  </Form>
);

export default App;