mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-27 05:30:14 +08:00
50 lines
990 B
JavaScript
50 lines
990 B
JavaScript
import React, { Component } from 'react'
|
|
import PropTypes from 'prop-types'
|
|
import { connect } from 'react-redux'
|
|
import wangEditor from 'wangeditor'
|
|
import { getResParams } from '../../../actions/addInterface.js'
|
|
|
|
@connect(
|
|
state => {
|
|
return {
|
|
resParams: state.addInterface.resParams
|
|
}
|
|
},
|
|
{
|
|
getResParams
|
|
}
|
|
)
|
|
|
|
class ResParams extends Component {
|
|
static propTypes = {
|
|
resParams: PropTypes.string,
|
|
getResParams: PropTypes.func
|
|
}
|
|
|
|
constructor(props) {
|
|
super(props)
|
|
}
|
|
|
|
componentDidMount () {
|
|
var E = wangEditor
|
|
var editor = new E('#res-cover')
|
|
editor.customConfig.menus = []
|
|
editor.customConfig.onchange = html => {
|
|
this.props.getResParams(html)
|
|
}
|
|
editor.create()
|
|
}
|
|
|
|
render () {
|
|
return (
|
|
<section>
|
|
<div className="res-params">
|
|
<strong className="res-h3">返回参数 :</strong>
|
|
<div id="res-cover"></div>
|
|
</div>
|
|
</section>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default ResParams |