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

beforeRender 参数不应该为模板实例 #1

Open
lushijie opened this issue Oct 9, 2017 · 1 comment
Open

beforeRender 参数不应该为模板实例 #1

lushijie opened this issue Oct 9, 2017 · 1 comment

Comments

@lushijie
Copy link

lushijie commented Oct 9, 2017

this.config.beforeRender 第一个参数传递 new Sdopx(),这样在 beforeRender 的配置中无法 registerFunction、registerModifier 等全局操作, 应该传递 require('sdopx').Sdopx

@wj008
Copy link
Owner

wj008 commented Oct 9, 2017

首先 很感谢您的回复。
下面我说一下我的看法,因为 this.config.beforeRender 是每次渲染之前需要做的事情,所以我这里认为应该是 new Sdopx() 实例,Sdopx 不应该在这里来执行 registerFunction、registerModifier 函数,如果非要执行 也可以使用 opx._Sdopx 来注册,但是我建议最好单独给一个文件引入来处理。因为注册函数不是每次都需要注册,它只需要1次全局注册即可。 在 新的说明文档中我已经详细了使用的帮助,如果不是很合理,欢迎建议。

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

2 participants