简体   繁体   English

如何在 Next.js 中的 Link 之前添加一个空格?

[英]How to add a space before Link in Next.js?

How can I add a space before link?如何在链接前添加空格? Without CSS of course当然没有 CSS

Please check if you agree with our 
<Link href="/[slug]" as="/privacy-policy/">
    <a>Privacy policy</a>
</Link>

I also have a space after "... our " but the outcome is still this:我在“...我们的”之后也有一个空格,但结果仍然是这样的:

Please check if you agree with ourPrivacy policy

You can insert a space like this:您可以像这样插入一个空格:

Please check if you agree with our 
{" "}
<Link href="/[slug]" as="/privacy-policy/">
    <a>Privacy policy</a>
</Link>

By placing the space in double quotes and surrounding by curly braces you tell React to interpret the expression inside the braces, which forces it to include the space as a literal string.通过将空格放在双引号中并用大括号括起来,你告诉 React 解释大括号内的表达式,这迫使它包含空格作为文字字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM