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

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

边栏推荐
- JS promise, async, await simple notes
- Restoration of binary tree -- number restoration
- Some details about memory
- 创建酷炫的 CollectionViewCell 转换动画
- Paper reproduction: expressive body capture
- Minimize maximum
- BERT知识蒸馏
- Paper recommendation: relicv2, can the new self supervised learning surpass supervised learning on RESNET?
- 使用acme.sh自动申请免费SSL证书
- WinForm (I) introduction to WinForm and use of basic controls
猜你喜欢

Target detection - personal understanding of RCNN series

自定义View之基础篇

Emnlp2021 𞓜 a small number of data relation extraction papers of deepblueai team were hired

KD-Tree and LSH

In the future, how long will robots or AI have human creativity?

6 questions to ask when selecting a digital asset custodian

Games101 job 7-path tracing implementation process & detailed interpretation of code

Basics of customized view

自定义View基础之Layout

mysql字符串转数组,合并结果集,转成数组
随机推荐
Zed2 camera calibration -- binocular, IMU, joint calibration
袋鼠雲數棧基於CBO在Spark SQL優化上的探索
Basics of customized view
Reverse thinking: making cartoon photos real
Intercept file extension
BP neural network derivation + Example
(十五)红外通信
【深入kotlin】 - 初识 Flow
Course design summary
Traversal of binary tree -- restoring binary tree by two different Traversals
Conversion relationship between coordinate systems (ECEF, LLA, ENU)
深度学习分布式训练
Carrier coordinate system inertial coordinate system world coordinate system
[go deep into kotlin] - flow advanced
SQLite installation and configuration tutorial +navicat operation
BERT知识蒸馏
Preliminary understanding of DFS and BFS
Huawei equipment configuration MCE
Solving graph problems with union search set
Target detection - personal understanding of RCNN series