{{if eq 0 $.ParentId}} selected{{end}}上面这个在和数据库变量比的时候,有时候会报错,把0换成range的变量的时候
报错信息为:
at <eq .ID $.ParentId >: error calling eq: incompatible types for comparison
然后用下面的代码替换即可:
{{if compare .ID $.ParentId}} selected{{end}}{{if eq 0 $.ParentId}} selected{{end}}上面这个在和数据库变量比的时候,有时候会报错,把0换成range的变量的时候报错信息为: at <eq .ID $.ParentId >: error calling eq: incompatible types for comparison然后用下面的代码替换即可: {{if co...
{{if eq 0 $.ParentId}} selected{{end}}上面这个在和数据库变量比的时候,有时候会报错,把0换成range的变量的时候
报错信息为:
at <eq .ID $.ParentId >: error calling eq: incompatible types for comparison
然后用下面的代码替换即可:
{{if compare .ID $.ParentId}} selected{{end}}
评论
0成为第一个留下想法的人。