javascript - antd表格在不同的电脑上看起来不一样
问题描述
有下一个测试代码:
class MyApp extends React.Component {
render(){
const { getFieldDecorator } = this.props.form;
return (
<Form className="login-form">
<Form.Item>
{getFieldDecorator('username', {
trigger: 'onBlur',
validateTrigger: 'onBlur',
valuePropName: 'defaultValue',
initialValue: 123,
rules: [
{ required: true, message: 'Please input your username!' },
{ pattern: /^\s*[0-9]+\s*$/, message: 'wrong input!!!' }
]
})(
<Input
prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />}
placeholder="Username"
/>,
)}
</Form.Item>
<Form.Item>
{getFieldDecorator('password', {
rules: [{ required: true, message: 'Please input your Password!' }],
})(
<Input
prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />}
type="password"
placeholder="Password"
/>,
)}
</Form.Item>
</Form>
);
}
}
const App = Form.create()(MyApp);
export default App;
此代码创建一个表单和几个输入字段。在这段代码中,我检查了验证是如何工作的。此代码效果很好,并创建了一个界面,如图片 image1
当我在另一台计算机上运行此代码时,我得到以下图片image2,其中图标延伸到输入字段之外,并且当字段被验证时,该字段不是红色的。
请告诉我如何使表格看起来像第一种情况。
解决方案
推荐阅读
- ios - 将 UITextField 输入文本翻译成西班牙语运行时
- node.js - 使用 Sequelize 连接两个表时遇到问题
- sql - 创建有条件的表
- php - Symfony 1.4 sfMailer:配置 TLS 自签名
- python - 将字符串转换为相同字符串的值
- c# - WPF 中的阴影覆盖其他控件
- bash - 合计并平均每个相同字符串旁边的数字
- python-3.x - 在对象高度和宽度上裁剪二进制图像
- r - RSelenium 与 Docker。checkError(res) 中的错误
- javascript - 带有 React Native 的 Magento 2 REST API