dcloudio / dcloudio/uni-app

构建微信小程序时发现会对text组件的内容trim?

Open
#4,714 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
41.6k
Forks
3.7k
Avg merge
7h 6m
Merged PRs (30d)
6

Description

**问题描述**
如题,uni-app构建微信小程序时发现会对文本内容trim
原生的微信小程序开发方式不会出现该问题

**复现步骤**
` 1 2 3 4 5 `
构建后查看 WXML 内容,发现其变成了
`1 2 3 4 5`

开启微信提供的 `decode`属性后也能复现该问题:
` 1 2  3 `
构建后查看 WXML 内容发现:
`1 2  3`

另一个例子,发现其在 `text` 嵌套的情况下,把 `` 标签之前或者 `` 之后的空个格也trim掉了:
` 1 ASD 2 `
构建后查看 WXML 内容发现:
`1ASD2`

**预期结果**
不要trim

**实际结果**
` 1 2 3 4 5 `
构建后查看 WXML 内容,发现其变成了
`1 2 3 4 5`

开启微信提供的 `decode`属性后也能复现该问题:
` 1 2  3 `
构建后查看 WXML 内容发现:
`1 2  3`

另一个例子,发现其在 `text` 嵌套的情况下,把 `` 标签之前或者 `` 之后的空个格也trim掉了:
` 1 ASD 2 `
构建后查看 WXML 内容发现:
`1ASD2`

**系统信息:**
- 发行平台: 微信小程序
- 操作系统:MacOS 14.1.2 (23B92)
- uni-app版本: uni-app v3.8.12 uni-app cli v2.0.2-3081220230817001

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.