1.2.7 • Published 7 years ago
react-mhoc v1.2.7
react-mhoc
React高阶组件
- style-useable.js
componentWillMount
触发 style.use
componentWillUnmount
触发 style.unuse
import {styleUseable} from 'react-mhoc'
import style from './style.use.less'
@styleUseable(style)
class MyComponent extends React.Component {
// ....
}
- editable.js
可同步编辑props/state/...内部数据
- 参数
- groupName: string
编辑视图的组名(默认为组件名) - attrNames: Array
需要编辑的数据keyNames, props强制支持 (默认'state')
- groupName: string
import {editable} from 'react-mhoc'
@editable
class MyComponent extends React.Component {
// ....
// ref Api
open() {}
}
class App extends React.Component {
componentDidMount() {
// not existed open
// this.ref.open()
// ok
this.ref.comp.open()
}
render() {
<MyComponent ref={r => this.ref = r} />
}
}
ChangeLog
- 1.2.1
- 支持Array/Object的新增和删除
代码简单重构
- 1.2.2
- 添加 Hover 高亮
- 添加 View 按钮
1.2.7
7 years ago
1.2.6
8 years ago
1.2.5
8 years ago
1.2.4
8 years ago
1.2.3
8 years ago
1.2.2
8 years ago
1.2.1
8 years ago
1.2.0
8 years ago
1.1.9
8 years ago
1.1.8
8 years ago
1.1.7
8 years ago
1.1.6
8 years ago
1.1.5
8 years ago
1.1.4
8 years ago
1.1.3
8 years ago
1.1.1
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago