Explorar el Código

replace All 老手机bug

zhengkaixin hace 2 años
padre
commit
ecd135e135
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      pages/news/detalis.vue

+ 7 - 1
pages/news/detalis.vue

@@ -99,7 +99,13 @@
 				})
 			},
 			getcontent(){
-				this.content=this.detail.content.replaceAll("font-size","font-size:"+this.myFontSize+"px  ;  line-height: "+(this.myFontSize+10)+"px;test")
+				var key1="font-size"
+				var key2="font-size:"+this.myFontSize+"px  ;  line-height: "+(this.myFontSize+10)+"px;test"
+				
+				var reg=new RegExp(key1,'gi')
+				var content=this.detail.content.replace(reg,key2)
+				
+				this.content=content;
 				
 					
 			},