跳至内容
菜单
此问题已终结
2 回复
10628 查看

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
11255
2
5月 21
8107
2
2月 19
9776
0
7月 18
3456
0
6月 24
710