Ant Design 中如何防止文字换行?
在这个后面加文字不换行的方法是使用 CSS 的 'white-space' 属性,将其设置为 'nowrap'。在这个例子中,可以在 'a-form-model-item' 的样式中添加以下代码:
style="white-space: nowrap;"
这样,文字就会在同一行显示,而不会换行。完整的代码如下所示:
<a-form-model-item :labelCol="{span: 6}" :wrapperCol="wrapperCol1" label="借款金额" prop="arrears" style="width: 80%; white-space: nowrap;">
<a-input-number :min="0" :max="10000000000000" :step="0.01" v-model="mdl.arrears" />元
</a-form-model-item>
原文地址: https://www.cveoy.top/t/topic/cXgD 著作权归作者所有。请勿转载和采集!