使用 antd-mobile 的 InputItem 组件时发现没有属性可以控制文字靠右显示,我的代码如下:
<List>
<InputItem
{...getFieldProps('inputclear')}
clear
extra=""
placeholder=""
labelNumber={7}
>
<p style={{ color: "#ccc" }}>报名人姓名</p>
</InputItem>
</List>
<List>
<Picker
data={gender}
value={this.state.gender}
cols={1}
{...getFieldProps('gender')}
className="forss"
>
<List.Item arrow="horizontal">
<p style={{ color: "#ccc" }}>报名人性别</p>
</List.Item>
</Picker>
</List>
<List>
<Picker data={idType} cols={1} {...getFieldProps('gender')} className="forss">
<List.Item arrow="horizontal">
<p style={{ color: "#ccc" }}>报名人证件类型</p>
</List.Item>
</Picker>
</List>
<List>
<InputItem
{...getFieldProps('inputclear')}
clear
extra=""
placeholder=""
labelNumber={7}
>
<p style={{ color: "#ccc" }}>报名人证件号</p>
</InputItem>
</List>
最终效果是这样的:
希望实现的效果如下:
这是需要自己自定义什么样式吗?还是有现成的属性可以使用?
text-align: right