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

可以定义局部变量吗? #7

Closed
asinbow opened this issue Jul 4, 2012 · 3 comments
Closed

可以定义局部变量吗? #7

asinbow opened this issue Jul 4, 2012 · 3 comments

Comments

@asinbow
Copy link

asinbow commented Jul 4, 2012

或者有什么变通手段吗?

@PaulGuo
Copy link
Owner

PaulGuo commented Jul 5, 2012

Juicer 是兼容 micro-tmpl 的语法的,所以可以通过 <% Code Here %>,来书写原生 Javascript 代码的,从而变通实现这样的需求。

juicer('<% var localVariables = "Hi, Juicer."; %> ECHO: ${localVariables}', {localVariables: "I won't be displayed."});

上边的代码就会输出 “ECHO: Hi, Juicer.”

@PaulGuo PaulGuo closed this as completed Jul 5, 2012
@asinbow
Copy link
Author

asinbow commented Jul 5, 2012

好的谢谢!

@pulo
Copy link

pulo commented Sep 27, 2012

哈 刚好在找这个问题~太强了

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