Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

模版忽略前空格的问题 #2261

Closed
YanceyOfficial opened this issue Feb 26, 2019 · 5 comments
Closed

模版忽略前空格的问题 #2261

YanceyOfficial opened this issue Feb 26, 2019 · 5 comments
Assignees

Comments

@YanceyOfficial
Copy link
Contributor

YanceyOfficial commented Feb 26, 2019

如果标签内是普通文字,如 <Text>day - night</Text> ,在微信开发者工具可以正常看到day - night
如果是引用的变量,如:

const day = 'day'
const night = 'night'
<Text>{day} - {night}</Text>

你将会得到 day- night注意,day和-之间的空格消失了,现在不得不 <Text>{day{' '}- {night}</Text>

@taro-bot
Copy link

taro-bot bot commented Feb 26, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@taro-bot
Copy link

taro-bot bot commented Feb 26, 2019

CC @yuche

@Lionad-Morotar
Copy link

(⊙﹏⊙)

@yuche yuche closed this as completed in 34dc701 Apr 30, 2019
@Garfield550
Copy link
Collaborator

这种我一般写成

{`${day} - ${night}`}

或者是开启 Text 的 spacedecode
image

@YanceyOfficial
Copy link
Contributor Author

这种我一般写成

{`${day} - ${night}`}

或者是开启 Text 的 spacedecode
image

cool,但用 React 按我的方式写是没问题的,所以还得算 Taro 的 bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants