js根据字节长度截取字符串
splitHandle(value, lineNum) { if(value == null) return null; lineNum = lineNum * 2;//一个汉字两个长度 var arr = value.split(""); var newArr = new Array(); var totalLen = 0; for(var i = 0; i < arr.length; i ++) { newArr.push(arr[i]); totalLen += this.getLength(arr[i]); if(totalLen % lineNum == 0) { newArr.push("<br />"); } } return newArr.join(""); }, getLength(str) { let len = 0; if (str.charCodeAt(0) > 127 || str.charCodeAt(0) == 94) { len += 2; } else { len ++; } return len; },