Test Consumer Provider

This commit is contained in:
2022-02-23 17:51:20 +08:00
parent 669d104eb3
commit 0eb0b6f7f5
5 changed files with 127 additions and 3 deletions
+18 -3
View File
@@ -1,13 +1,28 @@
import { Component, ReactNode, createRef } from "react";
import { Component, ReactNode } from "react";
import { SettingProvider, Setting } from "@Context/Setting";
import { HeaderBar } from "@Component/HeaderBar/HeaderBar";
import { Entry } from "../Entry/Entry";
import "./SimulatorWeb.scss";
class SimulatorWeb extends Component {
private canvasContRef = createRef<HTMLDivElement>();
/**
* 全局设置
*/
private setting: Setting;
public constructor(props: any) {
super(props);
// TODO: 这里要读取设置
this.setting = new Setting();
(window as any).setting = (this.setting as any);
}
public render(): ReactNode {
return <div>Web</div>
return <SettingProvider value={this.setting}>
<HeaderBar/>
</SettingProvider>
}
}