We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
例如我需要实现一个组件挂载时给body加上一个类名的高阶组件。
const withBodyClass = Component => Component.extend({ init() { document.body.class = 'classname'; } destory() { document.body.class = ''; } })
但是,貌似Regular的组件并不支持这样。如果我传入一个
const MyComponent = Regular.extend({ name: 'MyComponent' ... }) const HOBodyClass = withBodyClass(MyComponent);
全局的MyComponent还是原始的定义。
请问Regular中是如何实现这类组件的?
The text was updated successfully, but these errors were encountered:
支持这种写法,应该仅仅需要查找name或其他实例属性的时候增加一步向上ProtoType的查找。这样高阶组件查找到name后就可以覆盖原始的定义。
Sorry, something went wrong.
No branches or pull requests
例如我需要实现一个组件挂载时给body加上一个类名的高阶组件。
但是,貌似Regular的组件并不支持这样。如果我传入一个
全局的MyComponent还是原始的定义。
请问Regular中是如何实现这类组件的?
The text was updated successfully, but these errors were encountered: