调用JavaScript功能以更新Nunjucks模板中的过滤器?
是否可以调用JS函数并将变量传递到Nunjucks模板中。
{{ filter }}
{% set filterParam = orderBy() %}
{{ filter }}
{% for item in items | sort(true, true, filterParam) %}
Is it possible to call a js function and pass a variable into nunjucks template..?
{{ filter }}
{% set filterParam = orderBy() %}
{{ filter }}
{% for item in items | sort(true, true, filterParam) %}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的意思是装载机的意思?
What do you mean by loaders?
要在模板中使用函数,应将其定义为全局。
To use a function inside a template you should define it as global.