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

30 lines
858 B

6 years ago
import { commandMachine } from './Editor/CommandMachine';
import './UI/Css/style.less';
import './UI/Css/golden.less';
6 years ago
import { WebCAD } from './UI/Layout/ApplicationLayout';
import "../node_modules/@blueprintjs/icons/lib/css/blueprint-icons.css";
// 禁止选中
document.onselectstart = () => false;
// 禁止右键
// document.oncontextmenu = () => false;
7 years ago
window.onload = function ()
{
new WebCAD("app");
// -----热模块替换的代码.
async function loadFirst()
{
let cmd = (await import("./Add-on/testEntity/test")).Test;
commandMachine.RegisterCommand("tt", new cmd());
}
loadFirst(); // 必须先加载一次,否则无法触发热模块替换
if (module.hot)
{
module.hot.accept('./Add-on/testEntity/test', loadFirst)
}
};