beego模板中对变量的对比
{{if eq 0 $.ParentId}} selected{{end}}上面这个在和数据库变量比的时候,有时候会报错,把0换成range的变量的时候报错信息为: at <eq .ID $.ParentId
>: error calling eq: incompatible types for comparison然后用下面的代码替换即可: {{if compare .ID ...
2019-08-03