From 23ae46b3d2b60b60a72c0192a5a2496fcbbf0b6b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 1 Jul 2019 11:23:10 +0800 Subject: [PATCH] css --- .../src/modules/courses/boards/BoardsNew.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/boards/BoardsNew.js b/public/react/src/modules/courses/boards/BoardsNew.js index 6932b96cf..a7f59f39a 100644 --- a/public/react/src/modules/courses/boards/BoardsNew.js +++ b/public/react/src/modules/courses/boards/BoardsNew.js @@ -26,7 +26,8 @@ class BoardsNew extends Component{ this.state = { fileList: [], - boards: [] + boards: [], + title_num: 60 } } addSuccess = () => { @@ -93,7 +94,8 @@ class BoardsNew extends Component{ status: 'done' } }) - this.setState({ fileList: _fileList, board_name: data.board_name }) + + this.setState({ fileList: _fileList, board_name: data.board_name, title_num: 60 - parseInt(data.subject.length) }) } } }) @@ -228,8 +230,14 @@ class BoardsNew extends Component{ }); } // 附件相关 ------------ END + changeTitle=(e)=>{ + console.log(e.target.value.length); + this.setState({ + title_num: 60 - parseInt(e.target.value.length) + }) + } render() { - let { addGroup, fileList, course_id } = this.state; + let { addGroup, fileList, course_id, title_num } = this.state; const { getFieldDecorator } = this.props.form; const formItemLayout = { @@ -318,6 +326,8 @@ class BoardsNew extends Component{ position: 'absolute' }}>置顶 )} + {/* checkbox 有个边距样式 .ant-checkbox-wrapper + span, */} + {getFieldDecorator('subject', { rules: [{ required: true, message: '请输入标题', @@ -325,7 +335,8 @@ class BoardsNew extends Component{ max: 60, message: '最大限制为60个字符', }], })( - + )}