当前位置:网站首页>微信小程序text内置组件换行符不换行的原因-wxs处理换行符,正则加段首空格
微信小程序text内置组件换行符不换行的原因-wxs处理换行符,正则加段首空格
2022-06-11 05:28:00 【aliven1】
通过response,查看从服务器返回的数据源,换行的部分是否是:\n,如果是\n,通过转义,就变成了普通的字符串\n,所以不会换行
解决方案:
- 正则替换
- 在wxml引用wxs,实现内容的过滤:wxs只是语法跟js中的es5类似,其实是另一种语言

wxs中使用正则,给换行内容加段首空格

边栏推荐
- Solving graph problems with union search set
- KD-Tree and LSH
- Technology | image motion drive interpretation of first order motion model
- Share | defend against physically realizable image classification attacks
- 【深入kotlin】 - 初识 Flow
- Poverty has nothing to do with suffering
- Chapter I: Net architecture (1)
- How much current can PCB wiring carry
- Get the third-party interface
- SQLite installation and configuration tutorial +navicat operation
猜你喜欢

WinForm (II) advanced WinForm and use of complex controls

Recommend a free intranet penetration open source software that can be used in the local wechat official account under test

Using keras to build the basic model yingtailing flower

BERT知识蒸馏

Analyze while doing experiments -ndk article -jni uses registernatives for explicit method registration

自定义View基础之Layout

Conversion relationship between coordinate systems (ECEF, LLA, ENU)

Huawei equipment configuration MCE

NVIDIA SMI has failed because it could't communicate with the NVIDIA driver

Maximum number of points on the line ----- hash table solution
随机推荐
【入门级基础】Node基础知识总结
使用acme.sh自动申请免费SSL证书
Huawei equipment is configured to access the virtual private network through GRE
[project - what are the supporting materials in the annexes? (18 kinds of 2000 word summary)] project plan of innovation and entrepreneurship competition and supporting materials of Challenge Cup entr
SwiftUI: Navigation all know
一大厂95后程序员对部门领导不满,删库跑路被判刑
Section III: structural characteristics of cement concrete pavement
Zed2 running vins-mono preliminary test
PCB走線到底能承載多大電流
How to make lamps intelligent? How to choose single fire and zero fire intelligent switches!
Feynman learning method
WinForm (I) introduction to WinForm and use of basic controls
Retinanet+keras train their own data set to tread on the pit
The central rural work conference has released important signals. Ten ways for AI technology to help agriculture can be expected in the future
Paper reproduction: expressive body capture
Intercept file extension
如何让灯具智能化,单火、零火智能开关怎么选!
Section II: structural composition characteristics of asphalt pavement (1) structural composition
The programmers of a large factory after 95 were dissatisfied with the department leaders, and were sentenced for deleting the database and running away
Share | guide language image pre training to achieve unified visual language understanding and generation