1
2
3
4
5
|
<#
if
target??>
xxxx
</#
if
>
|
上面這段代碼判斷target??是否為null,如果不為null時才可以執行if里面的內容,為null時則不進到
if里面
1
2
3
4
5
|
<#
if
target?? && target !=
""
>
xxxx
</#
if
>
|
上面這段代碼如果target為空字符串時標簽中的內容將不會顯示, target??是判斷target不為null
並不能判斷target不為空,當target為空字符串時,則target??為true,條件為真則進入后面的判斷,target != ""判斷的
是target不為空則條件為真,當target是空字符串時,程序就進不去這個判斷