跳至內容
選單
此問題已被標幟
3 回覆
15383 瀏覽次數

 I would like to use t-if condition to check whether a field name (Ex.: 'Total Value') contains a string '**Total**'. I tried using:

t-if = 'Total' in a.name but it seems to check whether a.name is equal to 'Total'. 

頭像
捨棄
最佳答案

Hi,

Try it like this, it normally works

<t t-if="'Total' in a.name">

頭像
捨棄
作者

It works, thanks :)

最佳答案

<t t-if="'Total' in a.name">

Correct me,If I am wrong
 Thank you


頭像
捨棄
最佳答案

My guess is that it should probably be unicode:

<t t-if="u'Total' in a.name">
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
2月 18
3432
0
2月 18
3330
1
7月 25
1734
1
5月 25
1741
1
4月 25
2300