gpt4 book ai didi

html - Jade mixin 中的多个 block

转载 作者:搜寻专家 更新时间:2023-10-31 08:17:55 24 4
gpt4 key购买 nike

我只是想知道有没有办法向 Jade mixin 添加多个 block 。

例如,您可以使用此代码:

mixin article
block
p Mixin paragraph


+article
p This is my first block

但是我想知道有没有办法像这样在 Jade mixin 中使用具有不同内容的多个 block :

mixin article
block
p Mixin paragraph
block

请记住使用:

+article
p This is my first block

会产生重复的输出(它会显示“This is my first block twice”),如下所示:

<p>This is my first block</p>
<p>Mixin paragraph</p>
<p>This is my first block</p>

这不是我想要做的。

基本上我要问的是我可以使用这种混合:

mixin article
block
p Mixin paragraph
block
block

并获得以下 HTML 输出:

<p>This is my first block</p>
<p>Mixin paragraph</p>
<p>This is my second block</p>
<p>This is my third block</p>

我只是想知道我可以使用两个或更多不同的 block ,当然有不同的内容,使用 Jade mixin,还是每个 mixin 只能使用一个 block ?

最佳答案

我在 Jade 的 GitHub 问题部分发布了类似的帖子:

https://github.com/tj/jade/issues/1693

Currently, we don't support that, you can repeat the block keyword, but it will just repeat the same block multiple times. There is some work going in to adapting how mixins work though, so this may be something we support in the future.

关于html - Jade mixin 中的多个 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26400775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com