freemaker 的错误解决
不能使用“$ {”在这里你已经在 freemaker 的表达方式里面了
意思就是,你这个 表达式 被 freemaker 的表达式 给包围了,所以此处的表达式不需要些 ${}
符号了。
0down vote | Change (or you can do |
将${} 去掉即可。
比如:
<#list myplanppScoreList.planeeMyList as planeeMy>
<div class="border_dotted marginTop_15 padding_15">
<!-- 工作目标 -->
<div style="margin-left: 25px;">
<h4>${planeeMy.hepplaneePo.title}</h4>
<p><h5>类别:
<#assign ptype = planeeMy.hepplaneePo.type>
<#if (ptype==1)>OKR
<#else> 重点工作 </#if>
不需要 改为 <#assign ptype = ${planeeMy.hepplaneePo.type}> 的否则会报错的
一般是被 list 或者是 #if 给包围了,那么在 这些里面 再写 比如 #if 表达式 就不需要 将后台的获取的数据 使用 ${}来表示了。
- <#if condition>…
- <#elseif condition>…
- <#elseif condition>…
- <#else> …
- </#if>
- 例子如下:
- <#assign age=23>
- <#if (age>60)>老年人
- <#elseif (age>40)>中年人
- <#elseif (age>20)>青年人
- <#else> 少年人
- </#if>