wizlong react components
npm install wiz-componentswiz-components是wizlong的组件库,主要存放基础组件。组件来源目前有两种,一部分是封装了Ant Design的部分组件,另外一部分是由自己封装的组件。
npm install git+https://givtlab.wizlong.com/sgm/wiz-components.git
``jsx
import { WizNotice,WizAlert,WizSpin } from 'wiz-components'
//WizNoticekey;
WizNotice.info('基本信息!');
WizNotice.success({message:'成功了', description:'成功了!'});
//WizAlert
//WizSpin
`
MIT Copyright (c) 2018 - forever Naufal Rabbani
#####1. 组件名称 componentName
使用WizComponent时需要定义 component的名称。
#####2. React生命周期方法shouldComponentUpdate的封装
WizComponent对生命周期的shouldComponentUpdate方法进行了封装=>propsAndStateOnChange,优化了实例属性发生变化时的性能优化。
######propsAndStateOnChange使用方法
`js
//对所需要的实例属性进行监听
propsAndStateOnChange = {
listen: this._listen.bind(this)
}
//监听方法,入参与shouldComponentUpdate的相同
_list(nextProps,nextState){
//do something
}
``