gpt4 book ai didi

javascript - 在 Jade Mixin 中显示中断标签

转载 作者:行者123 更新时间:2023-11-30 16:02:55 25 4
gpt4 key购买 nike

我有一个 JSON 文件,在 Jade Mixin 中被调用以显示文本。但是,我需要在其中一个 JSON 字段中插入一个中断标记,但不知道如何在 Jade Mixin 中完成此操作。我似乎无法在任何地方找到相关信息。

这是 JSON 文件:

"features": {

"employers": {
"title": "For Employers",
"description": "Company corporate financial wellness program is designed to help employers lessen financial stress in the workplace, increase retirement readiness, and strengthen workplace culture.<br />Company offers a holistic approach to corporate financial wellness.",
"featureList": [
{
"iconSlug": "puzzle",
"title": "Easy Implementation",
"description": "Company provides a robust, custom marketing and communication plan to help drive program awareness and engagement."
},
{
"iconSlug": "rays",
"title": "Ongoing Engagement",
"description": "Get metrics around your employees’ engagement with the program and workplace impact."
},
{
"iconSlug": "dollarSign",
"title": "Affordable Pricing",
"description": "Explore our pricing options for all company sizes, including low, per- employee rates that can be paid out of ERISA budgets."
}
],
"cta": {
"title": "Contact our team",
"class": "trigger-emailFormScroll"
}
}

这是引入它的 Mixin:

mixin FeaturesModule(config)
h3.lvHeading.lvHeading-size3.lvHeading-main= config.title
h5.lvHeading.lvHeading-size5= config.description

- if (config.cta && typeof config.cta.newPage === "undefined") { config.cta.newPage = true; }

.layout-stdGrid
each feature, i in config.featureList
.stdGrid-col8.stdGrid-col-thin.padding-2
abbr(class= "icon-mktgLight-" + feature.iconSlug)
h6.lvHeading.lvHeading-size5.lvHeading-main!= feature.title
span.block= feature.description

- if (config.featuredLink)
a.link-featured.margin-Y-1.block(href= config.featuredLink.href, name=config.featuredLink.title, target= "_blank")= config.featuredLink.title
- else if (config.cta)
- if (config.cta.href)
a.button.button-wide(href= config.cta.href, target= (config.cta.newPage) ? "_blank" : undefined)= config.cta.title
- else
- var ctaClass = config.cta.class || "";
button.button.button-wide(class= ctaClass)= config.cta.title

span.block = feature.description 是我目前正在使用的。让 mixin 解释 break 标签的最佳方法是什么,这样它就不会作为文本打印在页面上?

提前致谢。

最佳答案

两种解决方案都有效:

span.block!=feature.description

span.block!{feature.description}

关于javascript - 在 Jade Mixin 中显示中断标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37441959/

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