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

Please help me here

this is in my template

<t t-set=”abcd” t-value=”my_function()” /> 
<t t-esc="abcd"/>

this is my java script

<script>
function my_function(){
var msg= 'Hello';
return msg;
}
</script>


頭像
捨棄
最佳答案

<t t-set="count" t-value="window.my_function()" />

if you want to pass other function which is not availabe at window global object then pass it as args like

$(QWeb.render('my_tempalte', {my_function: widget.my_function}));
it will call by <t t-set="abcd" t-value="my_function()" />


頭像
捨棄
最佳答案

do you solv this problem? 


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
8月 22
11109
2
5月 21
7928
2
2月 19
9619
0
7月 18
3342
0
6月 24
610