You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/src/index.tsx

50 lines
1.3 KiB

import * as React from "react";
7 years ago
import * as ReactDOM from 'react-dom';
import '../node_modules/golden-layout/src/css/goldenlayout-base.css';
import '../node_modules/golden-layout/src/css/goldenlayout-dark-theme.css';
import "./UI/Css/style.less"
import { LoadLayoutNotHead } from './UI/Layout/Layout';
import { CommandComponent } from "./UI/Components/Command";
import { App } from './UI/App';
7 years ago
import { commandStore } from './UI/Store/CommandStore';
import { autorun } from 'mobx';
import { Provider } from "mobx-react";
function createRootElement()
7 years ago
{
var root = document.createElement('div');
root.id = "app"
7 years ago
root.style.height = "100%";
document.body.appendChild(root);
return root;
}
7 years ago
function renderCommand()
{
let commandEl = document.getElementById("commandContainer")
ReactDOM.render(
<Provider commandStore={commandStore}>
<CommandComponent />
</Provider>,
commandEl
)
}
// window.onload = function ()
// {
// createRootElement();
7 years ago
// LoadLayoutNotHead();
// renderCommand();
// };
window.onload = () =>
{
ReactDOM.render(
<Provider commandStore={commandStore}>
<CommandComponent />
</Provider>,
createRootElement()
)
}
7 years ago
window["tt"] = commandStore;