过滤器 default,当变量值为0或者false,结果走的是defaultValue
Closed this issue · 1 comments
xdd-lisa commented
描述问题:
过滤器 default,当变量值为0或者false,结果走的是defaultValue
文档中说明的当变量值为空时,显示其他值代替,数字0属于变量值为空吗
截图或视频:
如何复现(请务必完整填写下面内容):
-
amis 版本是什么?请先在最新 beta 版本测试问题是否存在
最新版本 -
粘贴有问题的完整
amis schema
代码:
{
"type": "page",
"data": {
"html": 0
},
"body": {
"type": "tpl",
"tpl": "0时会取默认值问题: ${html|default:100}"
}
}
- 操作步骤
请简单描述一下复现的操作步骤...
allenve commented
可以使用严格模式:${html|default:100:true}