<div style="${properties.position == 'bottom'? 'bottom: ${properties.HeightValue}' : ': unset' @ context='styleString'}">
大家好,我正试图在我的AEM的内联样式代码中添加一个条件,这两个值都存在。我只能看到第一个条件,${properties.position == 'bottom'起作用了,但是${properties.HeightValue}显示为字符串。
在DOM上,它如下所示:<div style="bottom: ${properties.HeightValue}">
我尝试了一些其他的方法,但仍然不起作用,不知道你们是否知道如何解决这个问题。
我也尝试过这种方法,但效果不佳:top: ${properties.position == 'bottom'? '${properties.HeightValue}' : '0''},谢谢!
发布于 2021-02-21 15:15:52
你不能像那样嵌套表达式。你可以做的是去掉固定的部分,只留下三元中的变量:
<div style="bottom: ${properties.position == 'bottom' ? properties.HeightValue : 'unset' @ context='styleString'}">https://stackoverflow.com/questions/66299725
复制相似问题