diff --git a/src/components/knockGold/index.less b/src/components/knockGold/index.less index 934c56f5..3f878773 100644 --- a/src/components/knockGold/index.less +++ b/src/components/knockGold/index.less @@ -328,4 +328,17 @@ #addNew1 { display: none; } +} + +.countBox_par { + position: relative; + display: inline-block; + + .countBox { + position: absolute; + color: #999; + bottom: 5%; + z-index: 999999; + right: 3%; + } } \ No newline at end of file diff --git a/src/components/knockGold/wangEditor.jsx b/src/components/knockGold/wangEditor.jsx index 9e5eb68e..18fedcfa 100644 --- a/src/components/knockGold/wangEditor.jsx +++ b/src/components/knockGold/wangEditor.jsx @@ -1,10 +1,12 @@ import React from 'react' import Editor from 'wangeditor' +import './index.less' export default class wangeditor extends React.Component { constructor(props) { super(props) this.state = { - editorHtml: '' + editorHtml: '', + count: 0 } } componentDidMount() { @@ -39,6 +41,7 @@ export default class wangeditor extends React.Component { self.props.setEdittext(str) return } + self.setState({ count: text.length }) self.setState({ editorHtml: newHtml }) self.props.setEdittext(newHtml) } @@ -49,6 +52,11 @@ export default class wangeditor extends React.Component { } render() { - return
+ return ( +
+
+

{this.state.count + '/' + 500}

+
+ ) } }