Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

离线编译完的模块为什么不指明依赖 runtime? #4

Open
myhere opened this issue Jun 17, 2014 · 3 comments
Open

离线编译完的模块为什么不指明依赖 runtime? #4

myhere opened this issue Jun 17, 2014 · 3 comments

Comments

@myhere
Copy link

myhere commented Jun 17, 2014

现在预编译完的模块需要这样用:

var xtplMod = require('./items.xtpl');

var render= new XTemplateRuntime(xtplMod);

render.render({})

我觉得预编译完的模块返回 render 函数就好了,编译好的模块里依赖 runtime,这样使用起来就方便多了

@maxbbn
Copy link
Contributor

maxbbn commented Jun 18, 2014

突然想到如果硬编译进去, render 初始化的时候就无法传递配置进去了吧

@myhere
Copy link
Author

myhere commented Jun 18, 2014

那 render 的时候传递两个参数进去?

xtplMod.render(options, data)

@daxingplay
Copy link
Contributor

看起来好像很厉害的样子

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants