清理代码 修改错误.fuck

pull/7/head
cx 7 years ago
parent 0cd2ebb250
commit 67e9f7091c

@ -37,27 +37,25 @@ export class CommandComponent extends React.Component<{ commandStore?: CommandSt
render() render()
{ {
return ( return (
<Provider commandStore={this.props.commandStore}> <div id="commands" className="win"
<div id="commands" className="win" style={this.style}
style={this.style} >
<div className="tool-caption"></div>
<div className="content panel"
style={{ padding: 0 }}
> >
<div className="tool-caption"></div> <CommandLineContainer />
<div className="content panel" <div className='terminal-input'>
style={{ padding: 0 }} <input type="text" id="command-input"
> ref={input => { this.input = input }}
<CommandLineContainer /> placeholder="请输入命令:"
<div className='terminal-input'> onKeyDown={this.onInputKeyDown}
<input type="text" id="command-input" onChange={this.onInputChange}
ref={input => { this.input = input }} />
placeholder="请输入命令:"
onKeyDown={this.onInputKeyDown}
onChange={this.onInputChange}
/>
</div>
</div> </div>
<DevTools /> </div>
</div > <DevTools />
</Provider> </div >
); );
} }
onInputChange = (e: React.FormEvent<HTMLInputElement>) => onInputChange = (e: React.FormEvent<HTMLInputElement>) =>

@ -9,7 +9,6 @@ import { App } from './UI/App';
import { commandStore } from './UI/Store/CommandStore'; import { commandStore } from './UI/Store/CommandStore';
import { autorun } from 'mobx'; import { autorun } from 'mobx';
import { Provider } from "mobx-react"; import { Provider } from "mobx-react";
function createRootElement() function createRootElement()
{ {
var root = document.createElement('div'); var root = document.createElement('div');
@ -41,7 +40,9 @@ function renderCommand()
window.onload = () => window.onload = () =>
{ {
ReactDOM.render( ReactDOM.render(
<CommandComponent commandStore={commandStore} />, <Provider commandStore={commandStore}>
<CommandComponent />
</Provider>,
createRootElement() createRootElement()
) )
} }

Loading…
Cancel
Save