-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
@Qquanwei
Description
例如我需要实现一个组件挂载时给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中是如何实现这类组件的?