wxml文件
<van-field input-class='inputClass' readonly label="项目名称" maxlength="50" title-width="5em" placeholder="请输入名称"
value="{{detail.name}}" bindinput="getProject" name="stuClass" input-align="right" required
clearable />
注意文字长度限制
wxss文件
.inputClass{
white-space: nowrap !important;
text-overflow: ellipsis !important;
overflow: hidden !important;
}
注意 !important