javascript模板继承 [英] javascript template inheritance
本文介绍了javascript模板继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Django框架中,网页模板可以从其他模板继承。在子模板中,您可以定义代码块,这些代码块覆盖父模板中的命名块。我猜测还有其他后端模板系统也可以这样工作,但Django是我熟悉的。
In the Django framework, web page templates can inherit from other templates. In your child template, you define blocks of code which override like-named blocks in parent templates. I'm guessing there are other back-end templating systems which also work this way, but Django is the one I'm familiar with.
执行任何现有的javascript模板系统支持django样式的继承?
Do any of the existing javascript template systems support django-style inheritance?
推荐答案
如果你想要模板继承和DTL语法,你正在寻找什么? strong> Nunjucks :
What you're looking for if you want template inheritance and DTL syntax, is Nunjucks :
http:/ /mozilla.github.io/nunjucks/
这篇关于javascript模板继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文