公式修改

This commit is contained in:
18652063575 2022-10-27 10:29:13 +08:00
parent 54da9eb8cd
commit 3bef480242
1 changed files with 9 additions and 8 deletions

View File

@ -80,12 +80,13 @@ export default class FormalFormModal extends React.Component {
const str = propsTextarea.value.substring(end - 1, end);
if (str === "}") {
const index = propsTextarea.value.lastIndexOf("{", end - 1);
const currentValue = propsTextarea.value.substring(index, end);
const currentValue = propsTextarea.value.substring(index + 1, end);
console.log(currentValue);
console.log(propsTextarea.value.replace(currentValue, ""));
this.setState({
value: propsTextarea.value.replace(currentValue, "")
},()=>{
console.log(this.state.value);
propsTextarea.value= 'this.state.value';
propsTextarea.value= this.state.value;
});
}
}
@ -109,13 +110,12 @@ export default class FormalFormModal extends React.Component {
// 多行文本编辑
handleChange(value) {
console.log(value);
if (value && value.trim() == "") {
this.parameters = [];
}
// this.setState({
// value
// });
this.setState({
value
});
}
// 获取光标位置
@ -290,7 +290,8 @@ export default class FormalFormModal extends React.Component {
ref={(input) => this.contentProps = input}
minRows={8}
maxRows={8}
// value={value} onChange={(value) => this.handleChange(value)}
value={value}
onChange={(value) => this.handleChange(value)}
noResize={true}
style={{ fontSize: "14px", lineHeight: 1.2 }}
onKeyDown={this.triggerKeyDown}