在没有NodeJS的情况下使用EJS [英] Using EJS without NodeJS

查看:77
本文介绍了在没有NodeJS的情况下使用EJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为最新的构建版本将允许我在不使用节点的情况下全局使用ejs,所以我尝试这样做.

I figured that the latest build release would allow me to use ejs globally without using node so I tried doing so.

但是,当我尝试使用ejs.renderFile(params ...)时,出现错误:

Though, when I try to use ejs.renderFile(params...), i get the error:

TypeError: exports.fileLoader is not a function

这只是另一个节点模块.有办法解决这个问题吗?

Which is just another node module. Is there a way to get around this?

注意:这是我们唯一一次在我的公司使用EJS,因此,如果没有,您能为我指出如何呈现.ejs文件的正确方向.

Note: This is the only time we use EJS at my company, so, if not, would you kindly point me in a good direction in how to render .ejs files.

推荐答案

更新:您可以通过运行

new EJS({url: some/url/to/file.ejs}).render({dataToPass: data, moreData: secondData});

这篇关于在没有NodeJS的情况下使用EJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆