Commit 45fbe61e authored by Mac's avatar Mac

品牌的 招引需求的空格换行处理

parent 8a3f174b
......@@ -592,6 +592,10 @@
this.active = 1;
}
this.details.imgs = [];
if(this.details.Other && this.details.Other!=''){
this.details.Other = this.textFormat(this.details.Other);
}
this.details.BannerList.forEach((x) => {
let obj = {
name: x,
......@@ -602,6 +606,16 @@
}
);
},
textFormat(val) {
// 格式化文字展示文本域格式文字
if (val) {
let newString = val.replace(/\n/g, '_@').replace(/\r/g, '_#');
newString = newString.replace(/_#_@/g, '<br/>'); // IE7-8
newString = newString.replace(/_@/g, '<br/>'); // IE9、FF、chrome
newString = newString.replace(/\s/g, '&nbsp;'); // 空格处理
return newString;
}
},
changeHandler(i) {
this.active = i;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment