玉的多重属性
Multiple attributes in jade
本文关键字:属性 更新时间:2023-09-26
我是Jade的新手,在添加依赖json数据的属性时遇到了问题。请参阅下面的代码:
- var promoCode = data.promoCode
- var instalments = data.instalments
div(class= promoCode === true ? "product__img-wrap_promo-code" : "")(class= instalments === true ? "product__img-wrap_instalments" : "")
现在,它对我来说很好,但我在控制台上收到了这样的通知:
C: ''mobileGit''mobile_frontend''www''markup''modules''product_new''product_new.jade,第11行:您不应该有具有多个属性的jade标签。
也许有人知道如何解决这个问题。
测试使用:http://jade-lang.com/demo/
- var promoCode = true
- var instalments = true
div(class=promoCode === true ? "product__img-wrap_promo-code" : "", class= instalments === true ? "product__img-wrap_instalments" : "")
HTML输出:
<div class="product__img-wrap_promo-code product__img-wrap_instalments"></div>
相关文章:
- RegEx删除空属性?例如,如果(class=“”||class=“”)移除;否则就下课
- 全局变量和全局对象的属性之间有什么区别吗
- 如果使用 lodash 将属性存在于另一个对象中,则向对象添加属性
- 如何在Bootstrap Modal中为动态点击生成的变量设置jade属性
- 序列化数据属性中对象的最可靠方法
- 分析高度属性时出现意外值{{specs.height}}.index.html
- TypeError:无法读取属性'推'未定义的JavaScript
- 同样,同样的错误'ahorcado.js:26未捕获类型错误:无法读取属性'beginPath'
- AngularJS-使用'true'属性
- 可以't使用JavaScript获取width属性
- 未捕获的TypeError无法读取未定义的属性socialsharing
- 如何使用javascript获取嵌套对象中所有子对象的单个属性
- JavaScript Pub/Sub属性访问问题
- 从JavaScript访问struts操作中的属性
- 是否可以从父类访问子类的属性
- 如何更改reactjs中外部/独立组件的状态或属性
- 如何在选项卡上定义属性'的主窗口对象
- 锚点元素的href属性自动更改
- jQuery最近父级的数据属性选择器
- 用于'魔术串'属性