textarea 通过value设置字符串到输入框时,只截取了前140个字符进去,例:
// .js
var str = “asdmasmdlaskmdklsadmlkasmnckasmclkanmksocaklcmnaskcklanmcasmcklsnmaclkacnlkasmcklamclkaslkasncmklasnmcklasmcksalcmlaksmclksacmlsaknhgacz,.xc nka.,zmxcklq,mlkcqdmjqasmdkqw;d;alsc;lsadk;am;lad;a;akdamc;lafakfsadkl;kl;dkldkl;kds;aldkasl;dkl;d;lasdk;ladkfjklsajlaskjfjksldfjlksajf…”; //很长的文本
this.setData({
value : str,
});
// .wxml
<textarea name=“input” class=“edit-input” auto-focus=“true” focus=“true” maxlength=“5000” type=“text” value="{{value}}" placeholder="{{textPlaceholder}}" />
此处通过js设置textarea的value值只显示前140个字符,在textarea中字符串没有达到最大长度,但是只截取了一部分显示到textarea中