gpt4 book ai didi

attributes - Jade : element attributes without value

转载 作者:行者123 更新时间:2023-12-04 00:04:03 26 4
gpt4 key购买 nike

我是使用 Jade 的新手——到目前为止它很棒。

但是我需要发生的一件事是具有“itemscope”属性的元素:

<header itemscope itemtype="http://schema.org/WPHeader">

我的 Jade 符是:
header(itemscope, itemtype='http://schema.org/WPHeader')

但结果是:
<header itemscope="itemscope" itemtype="http://schema.org/WPHeader">

我怎样才能确保得到正确的结果 -- itemscope而不是 itemscope="itemscope" ?

最佳答案

我刚刚在 Express.js/Jade 项目中尝试过,得到的结果是:

<header itemscope itemtype="http://schema.org/WPHeader"></header>

我也在 bash 中尝试过,然后得到和你一样的结果。

我会采用以下建议或在 Github 上创建问题。

itemscope="itemscope" will work just as well as just itemscope. It looks like that's the default behavior of Jade. I'd just go with it.

关于attributes - Jade : element attributes without value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11020142/

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