import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import wangEditor from 'wangeditor' import { Tabs } from 'antd' import { getResParams } from '../../../actions/addInterface.js' const editor = new wangEditor('#res-cover') @connect( state => { return { resParams: state.addInterface.resParams } }, { getResParams } ) class ResParams extends Component { static propTypes = { resParams: PropTypes.string, getResParams: PropTypes.func } constructor(props) { super(props) } initResParams () { const { resParams } = this.props if (resParams) { editor.txt.html(resParams) } } componentDidMount () { const reg = /(
)|(<\/p>)| |(
)|\s+|