Test Consumer Provider
This commit is contained in:
@@ -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>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user