jiu-lib-test-01
v0.1.9
Published
The seed project for React library.
Downloads
15
Readme
TitleWithEditor
本组件实现了可编辑的标题功能,适用于标题可编辑的场景。编辑时自动选中文字,编辑值为空自动恢复之前的值。
安装
使用npm:
$ npm i jiu-lib-test-01
How to Use
Import:
import { TitleWithEditor } from 'jiu-lib-test-01';
Render in your component:
render() {
const { title } = this.state
return (
<TitleWithEditor value={title} onChange={this.onTitleChange} />
)
}
API
value
显示在组件中的内容,类型为string
onChange(e)
组件内容改变时的回调函数,e为修改后的内容