除非并且直到我不更改组件的大小(可调整大小),否则不会显示 AceEditor
如果我添加任何其他 HTML 元素,例如
有没有办法让 Ace 编辑器在没有任何库的情况下调整大小。
<Resizable
defaultSize={{
width: 'auto',
height: 'auto',
}}
className="resizable-component"
>
<AceEditor
width="auto"
height="100%"
mode="html"
theme="monokai"
readOnly={false}
focus={autofocus}
onBlur={onBlur && (event => onBlur(id, event.target.value))}
onFocus={onFocus && (event => onFocus(id, event.target.value))}
onChange={this._onChange}
wrapEnabled={true}
showPrintMargin={true}
maxLines={40}
minLines={8}
highlightActiveLine={true}
setOptions={{
enableBasicAutocompletion: true,
enableLiveAutocompletion: true,
enableSnippets: false,
showLineNumbers: true,
tabSize: 2,
}}
/>
</Resizable>
额外问题:如何获得取决于窗口大小的最大线。
版本:
“可重新调整大小”:“6.2.0” “react-ace”:“8.0.0”