wx:if="{{condition}}"
这里的 condition 里不能有任何的'(' 或者 ')'么?
只要有括号就会报 attr wx:if unexpected token ')'
wx:if="{{condition}}"
这里的 condition 里不能有任何的'(' 或者 ')'么?
只要有括号就会报 attr wx:if unexpected token ')'
|
LeoEatleOct 29, 2016
1
可以有的,这个是 mustache 语法,我估计可能你用了全角符号
[mustache]( http://mustache.github.io/) |
|
2
@LeoEatle 没有使用全角的符号。。。只要是有括号就不行了, wx:if 和 hidden 这两个都不能用。在普通的字符串里用{{(xxx) ? a : b}} 这样就可以。
|
|
3
@ykwlv 可以给代码看看吗,你在 condition 写了什么逻辑呢?一般不要用复杂的逻辑,最好就是用一个布尔值变量,逻辑放在 js 里面控制这个布尔值变量
|